Generate a javascript to generate 5000 random numbers
Answers
Answered by
1
function randFiveThousand() {
var result = '';
for (var i = 0; i <= 5000; i++) {
result += Math.floor(Math.random() * 5000) + 1 + '\n';
}
console.log(result);
}
randFiveThousand();
when you weill execute this program in browser console you will get 5000 times random numbers will be printed.
var result = '';
for (var i = 0; i <= 5000; i++) {
result += Math.floor(Math.random() * 5000) + 1 + '\n';
}
console.log(result);
}
randFiveThousand();
when you weill execute this program in browser console you will get 5000 times random numbers will be printed.
Similar questions