Can someone tell me why this code is not working please? It’s supposed to add a forth element to the ‘freinds’ array.
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(user, friend) {
// change code below this line
user.data.friends.push(friend);
return user;
// change code above this line
}
console.log(addFriend(user, 'Pete'));