Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js random unique id

// You could generate an ID using a timer and avoiding duplicates using performance.now():
id = 'id' + performance.now()
dup = 'id' + performance.now()

console.log(id)
console.log(id.replace('.','')) // sexy id
console.log(id === dup) // false!
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #random #unique #id
ADD COMMENT
Topic
Name
9+7 =