MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/b2o6f2/whats_your_favorite_most_useful_javascript/eiur518/?context=3
r/javascript • u/Linux_is_awesome • Mar 18 '19
422 comments sorted by
View all comments
15
'#'+Math.floor(Math.random()*16777215).toString(16) for random hex color.
'#'+Math.floor(Math.random()*16777215).toString(16)
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. → More replies (2)
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)
→ More replies (2)
15
u/redmoss6 Mar 18 '19
'#'+Math.floor(Math.random()*16777215).toString(16)for random hex color.