Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

generate random string javascript

function random_string(strLen=8) {
    var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
    var result = ""
    var charactersLength = characters.length;

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

    return result;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #generate #random #string #javascript
ADD COMMENT
Topic
Name
1+7 =