Answers for "how to assign random values to an array"

0

define function to get random value from array

const randomValue = (list) => {
    return list[Math.floor(Math.random() * list.length)];
};
Posted by: Guest on January-30-2022
0

assigning an array with random numbers

public static double[] list() {
    anArray = new double[10];
    for(int i=0;i<anArray.length;i++)
    {
        anArray[i] = randomFill();
    }
    return anArray;
}
Posted by: Guest on June-29-2020

Code answers related to "how to assign random values to an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language