- Notifications
You must be signed in to change notification settings - Fork653
Closed
Description
This was a really great tutorial series - easy to follow and quick to build!
I think I have found a small issue with the following code:
Build-A-Quiz-App-With-HTML-CSS-and-JavaScript/12. Create a Spinning Loader/game.js
Line 30 in91c5022
formattedQuestion.answer=Math.floor(Math.random()*3)+1; |
Math.random()
returns a value in the range [0,1), i.e. it will never return 1 - seesource.
So it looks like the code will only return values of 1, 2 or 3. Never 4.
I think a simple fix is the following:formattedQuestion.answer = Math.floor(Math.random() * 4) + 1;
Metadata
Metadata
Assignees
Labels
No labels