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:
JD Isaacks
2017-06-20 17:55:44 -04:00
committed by John-David Dalton
parent bacaaaef8a
commit 61acdd0c29

View File

@@ -17,7 +17,7 @@ let idCounter = 0
* uniqueId()
* // => '105'
*/
function uniqueId(prefix) {
function uniqueId(prefix='') {
const id = ++idCounter
return `${prefix + id}`
}