Stuck to get the full array from random number in JavaScript

Please help me to solve this one

const randomNumber = () => Math.floor(Math.random()*1100);
let maxNumber = 0;
let arrayOfRandomNumber =[];
while(maxNumber<randomNumber){
  arrayOfRandomNumber.push(maxNumber);
  maxNumber=randomNumber;
  randomNumber();
}

I want to push all random number to this empty array. From this array I will find the largest number but I get only 0 on my array.



Read more here: https://stackoverflow.com/questions/64408721/stuck-to-get-the-full-array-from-random-number-in-javascript

Content Attribution

This content was originally published by Md Iqbal Hossain at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: