Created
August 17, 2020 06:34
-
-
Save fedeghe/a42f40ed3b925640009347befa6dd912 to your computer and use it in GitHub Desktop.
dummy function to generate uniq ids
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var uniqueID = new function () { | |
var count = 0, | |
self = this; | |
this.prefix = 'NS_'; | |
this.toString = function () { | |
count += 1; | |
return self.prefix + count; | |
}; | |
} | |
// no collisions possible | |
// console.log(`${uniqueID} ${uniqueID} ${uniqueID}`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment