From c1137b0900ad098fee2fca430d11f69dfc909d3b Mon Sep 17 00:00:00 2001 From: Arnav <70969910+Arnav-2004@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:21:02 +0530 Subject: [PATCH] fix(curriculum): update directions for step 66 of platformer game project (#54125) Co-authored-by: Joy Shaheb Co-authored-by: Jessica Wilkins <67210629+jdwilkin4@users.noreply.github.com> --- .../64c74a8a4138c6032241d498.md | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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*;?/);