mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-10-24 23:49:06 +08:00
fix(curriculum): corrected formula for generating a random number (#64231)
This commit is contained in:
+1
-1
@@ -79,7 +79,7 @@ So, if the decimal point is less than `5`, the number is rounded down. And if th
|
||||
```js
|
||||
const max = 10;
|
||||
const min = 5;
|
||||
const randomNum = Math.floor(Math.random() * (max - min)) + min;
|
||||
const randomNum = Math.floor(Math.random() * (max - min + 1)) + min;
|
||||
console.log(randomNum);
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user