How to generate random string in JavaScript

Strings
Last updated Mar 12, 2018
const length = 20;

//should NOT be used for cryptography
const randomString = [...Array(length)]
  .map(() => Math.random().toString(36)[5])
  .join("");
ga6fr8rf7uan1yn2adqy