Created
July 23, 2013 13:36
-
Star
(513)
You must be signed in to star a gist -
Fork
(86)
You must be signed in to fork a gist
-
-
Save 6174/6062387 to your computer and use it in GitHub Desktop.
Generate a random string in JavaScript In a short and fast way!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@zeelkakdiya constructive feedback to improve this code:
let
and in some casesconst
are more appropriatelet string
does not need${}