Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

random string from array javascript

var textArray = [
    'song1.ogg',
    'song2.ogg'
];
var randomNumber = Math.floor(Math.random()*textArray.length);
 
PREVIOUS NEXT
Tagged: #random #string #array #javascript
ADD COMMENT
Topic
Name
9+4 =