How to get UUID in your JavaScript code quickly

--

Hi guys!
Sometimes we need to make some variables like ID in our project.

How we can do these?

  1. Install a library like UUID πŸ˜’
  2. Use Crypto of a browser API 😍
let uuid = self.crypto.randomUUID();
console.log(uuid); // for example "36b8f84d-df4e-4d49-b662-bcde71a8764f"

Happy hacking! 😊

--

--

Responses (1)