Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript random char

const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
function generateRandomCode(){
    let result = ""
    let charactersLength = characters.length;
    for ( var i = 0; i < 6 ; i++ ) {
        result += characters.charAt(Math.floor(Math.random() * charactersLength));
    }
    return result
}
 
PREVIOUS NEXT
Tagged: #javascript #random #char
ADD COMMENT
Topic
Name
7+9 =