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
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #random #char
ADD COMMENT
Topic
Name
3+8 =