In the lesson Basic Data Structures: Iterate Through the Keys of an Object with a for…in Statement, I have a suggestion to make a portion of it more intuitive. I got confused upon the first reading and attempting of the challenge.
The issue concerns this snippet of code in particular:
for (let user in users) {
console.log(user);
};
It’s not intuitive that user is referring to a string, and not to another object. It’s not explained very well in the lesson text.
I think that if it were made explicit that user was referring to a string, it would lead to less confusion. Students would recognize that they couldn’t just access something like user.someProperty, and would have to access the parent object like parentObject.user.someProperty.