Is there a random function in javascript that doesn't take the range of two numbers?

后端 未结 0 1450
不知归路
不知归路 2020-12-05 11:37

I want the computer to randomly choose either 8 or 2. I tried doing (Math.random()*8)+2, it chooses a random number BETWEEN 8 and 2 but I want the computer to randomly choos

相关标签:
回答
  • 消灭零回复
提交回复
热议问题