Modify an Array Stored in an Object (Object.keys doesn't work)

Tell us what’s happening:

I used “return Object.keys(;” but it doesn’t work. can anybody explain to me why this isn’t working?

Thank you :slight_smile:

Your code so far

let user = {
  name: 'Kenneth',
  age: 28,
  data: {
    username: 'kennethCodesAllDay',
    joinDate: 'March 26, 2016',
    organization: 'freeCodeCamp',
    friends: [
    location: {
      city: 'San Francisco',
      state: 'CA',
      country: 'USA'

function addFriend(userObj, friend) {
  // change code below this line;
  return Object.keys(;

  // change code above this line

console.log(addFriend(user, 'Pete'));

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36.

Link to the challenge:

My guess is because you’re asking for the keys of an array.

return Object.keys(; === ['Sam', 'Kira', 'Tomo'];

Object.keys( === [ '0', '1', '2' ]

You are right.

Object.keys() method returns the array of Key values of an Object.
to get the values


is enough.