mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): update directions for step 66 of platformer game project (#54125)
Co-authored-by: Joy Shaheb <khondokoralam@gmail.com> Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com>
This commit is contained in:
+21
-2
@@ -7,7 +7,26 @@ dashedName: step-66
|
||||
|
||||
# --description--
|
||||
|
||||
Inside the constructor, add `this.position` and assign it an object with the `x` and `y` coordinates.
|
||||
When working with objects where the property name and value are the same, you can use the shorthand property name syntax. This syntax allows you to omit the property value if it is the same as the property name.
|
||||
|
||||
```js
|
||||
// using shorthand property name syntax
|
||||
obj = {
|
||||
a, b, c
|
||||
}
|
||||
```
|
||||
|
||||
The following code is the same as:
|
||||
|
||||
```js
|
||||
obj = {
|
||||
a: a,
|
||||
b: b,
|
||||
c: c
|
||||
}
|
||||
```
|
||||
|
||||
Inside the constructor, add `this.position` and assign it an object with the `x` and `y` coordinates. Make sure to use the shorthand property syntax .
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -17,7 +36,7 @@ You should have a `this.position` property.
|
||||
assert.match(code, /this\.position\s*;?/);
|
||||
```
|
||||
|
||||
The `this.position` property should be an object with the `x` and `y` coordinates.
|
||||
The `this.position` property should be an object with the `x` and `y` coordinates. Make sure to use the shorthand property syntax.
|
||||
|
||||
```js
|
||||
assert.match(code, /this\.position\s*=\s*{\s*x\s*,\s*y\s*,?\s*}\s*;?/);
|
||||
|
||||
Reference in New Issue
Block a user