Home > front end >  JS generated random number that is not repeated
JS generated random number that is not repeated

Time:10-10

4, the simulation of 22 selected five lottery lottery drawings,
(II) write getRandomNum (), 1-22 generated by the system (including 1 and 22) between the five don't repeat the integer, and returns a result,
By calling bosses don't know how to use js to write repeat random number? To train of thought in detail

CodePudding user response:

Randomly generated digital preservation into the array; Every generates a number to judge whether there has been a if there is a regenerated not preserved
  • Related