mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 19:07: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()
|
* uniqueId()
|
||||||
* // => '105'
|
* // => '105'
|
||||||
*/
|
*/
|
||||||
function uniqueId(prefix) {
|
function uniqueId(prefix='') {
|
||||||
const id = ++idCounter
|
const id = ++idCounter
|
||||||
return `${prefix + id}`
|
return `${prefix + id}`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user