Answers for "random string array"

2

random string from array javascript

var textArray = [
    'song1.ogg',
    'song2.ogg'
];
var randomNumber = Math.floor(Math.random()*textArray.length);
Posted by: Guest on July-02-2020
0

get raondom from array java

public static int getRandom(int[] array) {
    int rnd = new Random().nextInt(array.length);
    return array[rnd];
}
Posted by: Guest on June-04-2020
1

js random string from array

const randomElement = array[Math.floor(Math.random() * array.length)];
Posted by: Guest on April-07-2020
0

javascript generate random string from array

Math.random().toString(36).substr(2, 5);
Posted by: Guest on September-22-2021

Code answers related to "random string array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language