Answers for "random picker js string"

6

javascript function generate a random string

//Create a function that returns a string, of a given length
const genRand = (len) => {
  return Math.random().toString(36).substring(2,len+2);
}

console.log(genRand(8));
//Expected output example: 4yg020wn
Posted by: Guest on December-15-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language