Generating a random string using JavaScript

25th July 2020

Here's a quick and elegant way of generating a random string in JavaScript:

[...Array(10)].map(i=>(~~(Math.random()*36)).toString(36)).join('')