chore(curriculum): make braces optional in step 103, 104 platfomer game (#57797)

This commit is contained in:
Anna
2025-01-02 14:06:09 -05:00
committed by GitHub
parent 6a4662864b
commit ca3b73f881
2 changed files with 4 additions and 4 deletions

View File

@@ -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.

View File

@@ -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.