Generate an Array of All Object Keys with Object.keys()_something is wrong?

Generate an Array of All Object Keys with Object.keys()_something is wrong?
0

#1

In below, I pass the test. Bu I could not understand this part of Object.keys(). I read the instructions. I need return an array. But why is this correct ?

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(users);
  // change code above this line
}

console.log(getArrayOfUsers(users));

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:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures/generate-an-array-of-all-object-keys-with-object-keys


#2

To answer this I’ll refer you to MDN: