Random string ascii 0 9 a z A Z const digit a return a charCodeAt 0 const ascii d return String fromCharCode d let v 0 9 a z A Z let n Math floor Math random 3 let lo digit v n 0 let hi digit v n 1 let char ascii lo Math floor hi lo Math random console log char Random string const randomString len let res for let m 0 m len m ascii 0 9 a z A Z const digit a return a charCodeAt 0 const ascii d return String fromCharCode d let v 0 9 a z A Z let n Math floor Math random 3 let lo digit v n 0 let hi digit v n 1 res ascii lo Math floor hi lo Math random return res console log randomString 20
let res for let m 0 m len m ascii 0 9 a z A Z const digit a return a charCodeAt 0 const ascii d return String fromCharCode d let v 0 9 a z A Z let n Math floor Math random 3 let lo digit v n 0 let hi digit v n 1 res ascii lo Math floor hi lo Math random return res console log randomString 20