If you are using bracket notation to refer to a property name directly (i.e. not through a variable), always wrap the property name in quotes so that JS can identify it as a string and look for the property name in the object accordingly. In other words, do:
if (usersObj[user]["online"] === true){...
If you just have [online], JS will think that online is a variable and try to get its stored value, which will of course result in error.
You are right gaac510. In a part of JS Basic they teach us to use the notation by periods and brackets, there it shows us that sometimes inside the brackets it is necessary to use quotation marks, generally when there are two words inside. I recommend that you play with those possibilities until it works.