diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c74a8a4138c6032241d498.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c74a8a4138c6032241d498.md index 208077def2a..78296c2c791 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c74a8a4138c6032241d498.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-intermediate-oop-by-building-a-platformer-game/64c74a8a4138c6032241d498.md @@ -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*;?/);