let user = {
name: 'Kenneth',
age: 28,
data: {
username: 'kennethCodesAllDay',
joinDate: 'March 26, 2016',
organization: 'freeCodeCamp',
friends: [
'Sam',
'Kira',
'Tomo'
],
location: {
city: 'San Francisco',
state: 'CA',
country: 'USA'
}
}
};
function addFriend(userObj, friend) {
// Only change code below this line
return userObj.data.friends.push(friend);
// Only change code above this line
}
console.log(addFriend(user, 'Pete'));
userObj.data.friends.push(friend); // 4
return userObj.data.friends; //[ 'Sam', 'Kira', 'Tomo', 'Pete' ]