create unique id with javascript create unique id with javascript javascript javascript

create unique id with javascript


var id = "id" + Math.random().toString(16).slice(2)


another way it to use the millisecond timer:

var uniq = 'id' + (new Date()).getTime();


const uid = function(){    return Date.now().toString(36) + Math.random().toString(36).substr(2);}

This Function generates very unique IDs that are sorted by its generated Date.Also useable for IDs in Databases.