function myarray(min, max) {
var points = [];
for (var i = 0; i < 10; i++) {
points.push(Math.round(Math.random() * (1000 - 100 + 1) + 100));
points.join('<br>');
var largest = Math.max.apply(0, points);
}
return points
}
console.log(myarray());
My task is pretty simple, I want to create 10 random numbers from 1 to 1000 in an array and then print the highest one. I think I am pretty close but when I run this I get undefined
.
How can I fix this? and what is undefined?