Guest User

Untitled

a guest
Jul 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. const alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split('');
  2.  
  3. function generatePassword(L){
  4. return Array.from({length: L})
  5. .map(i => alphabet[Math.floor(Math.random() * alphabet.length)])
  6. .join("")
  7. }
  8.  
  9. console.log(generatePassword(14));
Add Comment
Please, Sign In to add comment