how to generate 6 random alphanumerals in js

Solutions on MaxInterview for how to generate 6 random alphanumerals in js by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "how to generate 6 random alphanumerals in js"
Niklas
04 Mar 2016
1let characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
2let result = ''
3let length = 10 // Customize the length here.
4for (let i = length; i > 0; --i) result += characters[Math.round(Math.random() * (characters.length - 1))]
5console.log(result)