generate unique id javascript
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
console.log(uuidv4());function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
var userID=uuid();//something like: "ec0c22fa-f909-48da-92cb-db17ecdb91c5"
Also in JavaScript:
- how to uncheck a checkbox in jquery
- ajax calls
- check if outside the div is clicked
- how to make a proxy server node.js
- import { Plugins } from '@capacitor/core'; cannot find
- what is pug template engine
- jqgrid beforeShowForm
- scroll position
- function(global factory)
- import javascript
- nodejs store selected dropdown in variable
- javascript automatic click
- axios react
- agregar año en javascript
- parsefloat jquery
- get location from ip node js
- javascript regex zero or more occurrence
- fetch multiple urls javascript
- Sum of all the multiples of 3 or 5
- how to add script before </body> in magento 2
- how to make a dictionary javascript
- The value associated with each key will be an array consisting of all the elements that resulted in that return value when passed into the callback.
- node js http request get parameters
- react hooks delete item from array