How can I solve this?

I am stuck on this.

1 Like

Don’t show my code before you check it again:

  1. Use or something to test it: what is your output? Why wrong?
  2. Next, console.log(something) to check code and know why wrong and fix it?
  3. See my code if you prepare to punch your laptop:
function countOnline(usersObj) {
  // change code below this line
 let count = 0
 for (let value in usersObj) {
      count = usersObj[value]['online'] ? count + 1 : count
 return count
  // change code above this line

maybe for next time instead of
you want to solve it
tell us
what have you tried
what is your code so far
what excatly is it that you find hard to understand

1 Like