I am having an issue in which i am trying to select a random number using an arrays length as the parameter.
var myArray = [1,2,3,4,5];
var r = Math.floor(Math.random(myArray.length));
That is what i have so far, if my array is size 7 for example i would like r to be a random number up to 7.
So far it return r as 0, even when testing in the browser console
Any help would be greatly appreciated!