Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript function to generate random alphanumeric string

var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
var result = ""
var charactersLength = characters.length;

for ( var i = 0; i < 5 ; i++ ) {
    result += characters.charAt(Math.floor(Math.random() * charactersLength));
}

console.log(result)
 
PREVIOUS NEXT
Tagged: #javascript #function #generate #random #alphanumeric #string
ADD COMMENT
Topic
Name
1+5 =