Tell us what’s happening:
Describe your issue in detail here.
I have already passed this challenge so my question is not about my code but about the hints given. Why does dot notation fail here?
**Your code so far**
function countOnline(usersObj) {
// Only change code below this line
// Only change code above this line
}
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Challenge: Iterate Through the Keys of an Object with a for…in Statement
Imagine that username is a string “john”. obj.john.online ← will work nicely
Now imagine that username is a string “john jr” obj.john jr.online ← this will throw an error because of a space.
JS will try to look for obj.john and then for jr.online.