MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/b2o6f2/whats_your_favorite_most_useful_javascript/eiur518
r/javascript • u/Linux_is_awesome • Mar 18 '19
422 comments sorted by
View all comments
Show parent comments
1
Anyone got anything for generating a random string of letters? I know you can use someNumber.toString(36) to get a string of letters and numbers, but I don't know how to get only letters.
someNumber.toString(36)
3 u/inu-no-policemen Mar 19 '19 > String.fromCharCode(...Array.from({length: 12}, _ => Math.random() * 25 + 97 | 0)) "niapavvsjdfb" 1 u/qbbftw Mar 19 '19 randexp is good at generating random strings, though it may not be as fast as the String.fromCharCode method
3
> String.fromCharCode(...Array.from({length: 12}, _ => Math.random() * 25 + 97 | 0)) "niapavvsjdfb"
randexp is good at generating random strings, though it may not be as fast as the String.fromCharCode method
String.fromCharCode
1
u/SuperFLEB Mar 19 '19
Anyone got anything for generating a random string of letters? I know you can use
someNumber.toString(36)to get a string of letters and numbers, but I don't know how to get only letters.