I am trying to populate with an array with a given number of elements(this parameter is stated in the function) given that there is a startValue and endValue for example populate myArray with 5 numbers between 5 and 15.
function populateArray(num, startValue, endValue){
var j,
localArray=[];
for(j=startValue;j<=endValue;j+=1){
var k = Math.floor(Math.random()* j);
localArray.push(k);
}
console.log(localArray);
}
where num is the number of elements wanted in the array _ I don't know how to implement this. thanks in advance.