let randomNum = (max,min,time)=>{ let newArr=[] for(let i=0;i<time;i++){ newArr.push(Math.floor(Math.random()*(max-min+1)+min)) } return newArr } console.log(randomNum(20,10,10))