1var ID = function () {
2 // Math.random should be unique because of its seeding algorithm.
3 // Convert it to base 36 (numbers + letters), and grab the first 9 characters
4 // after the decimal.
5 return '_' + Math.random().toString(36).substr(2, 9);
6};
1let ID = (length = 6) => {
2 // new Date() will return current time
3 // getTime() method returns the number of milliseconds* since the Unix Epoch.
4 // -length to get last items on string
5 return new Date().getTime().toString().slice(-length);
6}