From e10a046f8a04e99b3402a68f37f5aacc625ab4c8 Mon Sep 17 00:00:00 2001 From: Ashraf Nazar Date: Fri, 15 May 2020 22:41:40 +0100 Subject: [PATCH] fix(curriculum): use example in Modifying an Object Within a Nested Object challenge (#38468) * fix: use example in modifying an object within a nested object exercise to explain how to do so * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md Co-Authored-By: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> * Update curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> --- ...dify-an-object-nested-within-an-object.english.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md index 8857787557..24daa2ad35 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object.english.md @@ -18,18 +18,24 @@ let nestedObject = { online: 80, onlineStatus: { active: 67, - away: 13 + away: 13, + busy: 8 } } }; ``` -nestedObject has three unique keys: id, whose value is a number, date whose value is a string, and data, whose value is an object which has yet another object nested within it. While structures can quickly become complex, we can still use the same notations to access the information we need. +nestedObject has three properties: id (value is a number), date (value is a string), and data (value is an object with its nested structure). While structures can quickly become complex, we can still use the same notations to access the information we need. To assign the value 10 to the busy property of the nested onlineStatus object, we use dot notation to reference the property: + +```js +nestedObject.data.onlineStatus.busy = 10; +``` + ## Instructions
-Here we've defined an object, userActivity, which includes another object nested within it. You can modify properties on this nested object in the same way you modified properties in the last challenge. Set the value of the online key to 45. +Here we've defined an object userActivity, which includes another object nested within it. Set the value of the online key to 45.
## Tests