mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-12 21:01:52 -04:00
fix(curriculum): fixed strict regex (#54778)
This commit is contained in:
committed by
GitHub
parent
f0bbef2d8b
commit
1a97345aa4
@@ -34,13 +34,13 @@ assert.match(code, /const\s+randomDice\s*=\s*.*Math\.random\s*\(\s*\)\s*\*\s*6\s
|
||||
You should use `Math.floor()` to round the result down to the nearest whole number.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*/);
|
||||
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\(?\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*/);
|
||||
```
|
||||
|
||||
You should add `1` to the end result of your `randomDice` variable.
|
||||
|
||||
```js
|
||||
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*\+\s*1\s*/);
|
||||
assert.match(code, /const\s+randomDice\s*=\s*Math\.floor\s*\(\(?\s*Math\.random\s*\(\s*\)\s*\*\s*6\s*\)\s*\+\s*1\)?\s*/);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
Reference in New Issue
Block a user