Created
November 26, 2019 13:21
-
-
Save yairEO/f75de80b147c81fd688ffd323f8ad6a2 to your computer and use it in GitHub Desktop.
Generate javascript array with random strings
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
[...Array(10)].map(() => { | |
const randomStr = "abcdefghijklmnopqrstuvwxyz".split('').sort(() => .5-Math.random()).join(''); | |
return randomStr.slice(0, Math.random()*26 + 2) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another way I've found:
ES2015