-1

I have only been coding in my off time for a couple of weeks now and am creating an app with a very basic "guess how many" concept. The user will enter a number between 0-5 and the app will tell the user whether they are right or wrong.

How would I generate a number between 0-5?

1 Answers1

-1

You can use any random method and performing modulo operator on it

let randomNumber = random() % 6
Inder Kumar Rathore
  • 39,458
  • 17
  • 135
  • 184