Skip to content

Instantly share code, notes, and snippets.

@fedeghe
Created August 17, 2020 06:34
Show Gist options
  • Save fedeghe/a42f40ed3b925640009347befa6dd912 to your computer and use it in GitHub Desktop.
Save fedeghe/a42f40ed3b925640009347befa6dd912 to your computer and use it in GitHub Desktop.
dummy function to generate uniq ids
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