How to generate a UUID (Universally Unique Identifier) in JavaScript

1 Answer

0 votes
let s = crypto.randomUUID()
console.log(s);

s = crypto.randomUUID()
console.log(s);

   
   
 
   
/*
run:
   
"37581e5c-df43-4da1-b3bf-c462f87aa012"
"9ade452c-8711-4d6a-aead-a70e561c971f"
   
*/

 



answered Dec 12, 2021 by avibootz
...