You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportletrandomNumbers=(min,max,limit)=>newPromise((res,rej)=>{try{lettable=[];if(max==0)throw"max must to be a positive number";if(max<min)throw"max must to be great than min";if(max<limit-1)throw"max cannot be less than limit";for(leti=0;i<limit;i++){letx=Math.floor((Math.random()*(max-min+1))+min);if(table.indexOf(x)===-1)table.push(x);elsei--;}res(table);}catch(e){rej(e);}});
How we can using it in for loop?
The text was updated successfully, but these errors were encountered: