Tell us what’s happening:
Hi, I tried to solve the challenge with a couple of different approaches but I can’t understand why I still can’t resolve the last bit, “The online property is set using dot or bracket notation”.
Any hint? Thanks!
Your code so far
let userActivity = {
id: 23894201352,
date: 'January 1, 2017',
data: {
totalUsers: 51,
online: 45
}
};
// change code below this line
userActivity[ "data" ].online = 45; // 1st attempt
userActivity.data[ "online" ] = 45; //2nd attempt
// change code above this line
console.log(userActivity);
// myStorage.car[ "inside" ].glove
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/modify-an-object-nested-within-an-object