Question: I am making a game in which there will be a random number generated, and I want that many random numbers generated. So for example if the number is 6 i want 6 *more* random numbers to be generated. So is there a way to run a function containing this (and a few other things) X numebr of times?

Just a code example:

```
let circNum = Math.floor( Math.random() * 4 + 3 )
let circles = function() {
  //generate circNum random numbers
  //make circNum new divs
}

```

Answer: 
This function should do the job. 

1. rangeLow is the low range of the number of random generated numbers.
2. rangeHigh is the high range of the number of random generated numbers.
3. randRangeLow is the low range for the value of the random generated numbers.
4. randRangeHigh is the high range for the value of the random generated numbers.

```
function randomGen(rangeLow, rangeHigh, randRangeLow, randRangeHigh) {
    let randArray = [];
    for (i = 0;i < Math.floor(Math.random() * (rangeHigh - rangeLow + 1) + rangeLow);i++) {
        randArray.push(Math.floor(Math.random() * (randRangeHigh - randRangeLow + 1) + randRangeLow));
    };
    return randArray;
};

```
Try this:

```
   var arr = []
   while(arr.length < 6){
      var randomnumber=Math.ceil(Math.random()*100;
      if(arr.indexOf(randomnumber) > -1) continue;
      arr[arr.length] = randomnumber;
   }
   document.write(arr);

```