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;
```
userActivity
, which includes another object nested within it. Set the value of the online
key to 45
.
userActivity
should have id
, date
and data
properties.
testString: assert('id' in userActivity && 'date' in userActivity && 'data' in userActivity);
- text: userActivity
should have a data
key set to an object with keys totalUsers
and online
.
testString: assert('totalUsers' in userActivity.data && 'online' in userActivity.data);
- text: The online
property nested in the data
key of userActivity
should be set to 45
testString: assert(userActivity.data.online === 45);
- text: The online
property should be set using dot or bracket notation.
testString: 'assert.strictEqual(code.search(/online: 45/), -1);'
```