Statement Iteration

Tell us what’s happening:

Can some one please help me out with this I’ve been stuck for two days after checking the web I still can’t figure out what I have wrong

Your code so far

let users = {
  Alan: {
    age: 27,
    online: false
  Jeff: {
    age: 32,
    online: true
  Sarah: {
    age: 48,
    online: false
  Ryan: {
    age: 19,
    online: true

function countOnline(obj) {
  // change code below this line

for (let user in obj) {
 let userNumber = 0;
  if (obj[user]["online"] === true) {
  // change code above this line


Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36.

Link to the challenge:

You’ll want to declare the userNumber variable before starting the for-loop. Otherwise it will just reset to 0 at each loop.

Your function also isn’t returning a value.


thanks for the help I finally figured it out