I have written a function that generates different numbers each time it is called. Now I want it to genarate say 50 different numbers and then push it into an array. How do I go about it? This is the code below:
function generateRandomNumbers() {
let randomArray = [];
let digits = Math.floor(Math.random() * 900000000) + 100000000;
digits = `0${digits}`;
// Last task is to push 50 random digits into the array;
return randomArray;
}
console.log(generateRandomNumbers());