Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

generate random character in javascript

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

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

console.log(result)
 
PREVIOUS NEXT
Tagged: #generate #random #character #javascript
ADD COMMENT
Topic
Name
2+5 =