Generate an Array of All Object Keys with Object.keys() 2

Generate an Array of All Object Keys with Object.keys() 2
0

#1

Tell us what’s happening:

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 getArrayOfUsers(obj) {
  // change code below this line
  

  return  object.keys(obj); // After trying to run this  program. object is said to be undefined. kindly help is there a way to change this aspect?

  // change code above this line
}

console.log(getArrayOfUsers(users));

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object-keys


#2

Please help me understand what am I doing wrong here.


#3

You are trying to call object.keys() which does not exist. You need to use the Javascript Object.keys()

You also need to pass the users array as the parameter not obj