Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript array with random values

function randomArrayStr(maxWordLength,arrayLength = false){
    const arr = []
    while(arrayLength){
        arr.push(Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, maxWordLength))
        --arrayLength
    }
    return arr
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #array #random #values
ADD COMMENT
Topic
Name
2+3 =