Generation

generate functionFri, 02 Dec 2022

create a string of random characters with a maximum of 12 characters

Script function createRandomString() { var randomString = ''; var possible = 'abcdefghijklmnopqrstuvwxyz0123456789'; for (var i = 0; i < 12; i++) randomString += possible.charAt(Math.floor(Math.random() * possible.length)); return randomString; } console.log(createRandomString())

Questions about programming?Chat with your personal AI assistant