mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2025-12-23 21:04:36 -05:00
chore(curriculum): make braces optional in step 103, 104 platfomer game (#57797)
This commit is contained in:
@@ -9,7 +9,7 @@ dashedName: step-103
|
||||
|
||||
Inside your condition, add a `forEach` loop to iterate through the `checkpoints` array. Use `checkpoint` as the parameter name for the callback function.
|
||||
|
||||
Inside the loop, use the subtraction assignment operator to subtract 5 from the checkpoints's `x` position.
|
||||
Inside the `forEach` callback, use the subtraction assignment operator to subtract 5 from the checkpoints's `x` position.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -24,7 +24,7 @@ You should have a `checkpoint` parameter inside the `forEach` callback function.
|
||||
|
||||
```js
|
||||
const splitter = code.split("if (keys.rightKey.pressed && isCheckpointCollisionDetectionActive)")
|
||||
assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{/);
|
||||
assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{?/);
|
||||
```
|
||||
|
||||
You should use the subtraction assignment operator to subtract 5 from the `checkpoint`'s `x` position.
|
||||
|
||||
@@ -9,7 +9,7 @@ dashedName: step-104
|
||||
|
||||
Inside your `else if` statement, add a `forEach` loop to iterate through the `checkpoints` array. Use `checkpoint` as the parameter name for the callback function.
|
||||
|
||||
Inside the loop, use the addition assignment operator to add 5 to the checkpoints's `x` position.
|
||||
Inside the `forEach` callback, use the addition assignment operator to add 5 to the checkpoints's `x` position.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -24,7 +24,7 @@ You should use the `checkpoint` parameter inside the `forEach` callback function
|
||||
|
||||
```js
|
||||
const splitter = code.split("else if (keys.leftKey.pressed && isCheckpointCollisionDetectionActive) {")
|
||||
assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{/);
|
||||
assert.match(splitter[1], /checkpoints\.forEach\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*\{?/);
|
||||
```
|
||||
|
||||
You should use the addition assignment operator to add 5 to the `checkpoint`'s `x` position.
|
||||
|
||||
Reference in New Issue
Block a user