Modify an Array Stored in an Obj

Why i cannot return right away in a single line as i did here, and not repeated?
Answer isshowing:;

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

// Only change code above this line

console.log(addFriend(user, 'Pete'));
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Challenge: Modify an Array Stored in an Object

Link to the challenge:

What does the push method return?

I always forget all the details of all these methods. I just look them up.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.