Last active
May 31, 2019 02:55
-
-
Save kenmueller/6174a220b6ea8bf2dd1aef372e03756d to your computer and use it in GitHub Desktop.
Creates a random ID with a specified length
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
const newId = length => | |
[...Array(length)].map(_i => (~~(Math.random() * 36)).toString(36)).join('') | |
function newId(length) { | |
return [...Array(length)].map(_i => (~~(Math.random() * 36)).toString(36)).join('') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment