mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 06:27:49 +00:00
default prefix to empty string (#3214)
This starting returning NaN for me. It looks like it is trying to add undefined + number when there is no prefix.
This commit is contained in:
committed by
John-David Dalton
parent
bacaaaef8a
commit
61acdd0c29
@@ -17,7 +17,7 @@ let idCounter = 0
|
||||
* uniqueId()
|
||||
* // => '105'
|
||||
*/
|
||||
function uniqueId(prefix) {
|
||||
function uniqueId(prefix='') {
|
||||
const id = ++idCounter
|
||||
return `${prefix + id}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user