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:
Math.random()
returns a value in the range [0,1), i.e. it will never return 1 - see source.
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