Create A UUID In JavaScript

October 2021
const uuid = self.crypto.randomUUID();

Notes

  • Only works in "secure contexts" meaning HTTPS
  • Also works on localhost
end of line