Manipulating Complex Objects_2

Tell us what’s happening:
I’m lost again. I don’t know how to add separate, identical properties to an object. I do not want to add, delete or change the existing properties or their values in the myMusic object at the top. I simply want to add a new album with the same properties but with different values as the lesson require. I’m assuming they do not want something like this:
‘’’
var myMusic = [
{
“artist”: “Billy Joel”, " new artist",
//etc.
‘’’
but rather a whole new album separate from the top album. That’s what’s hard.

Your code so far


var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ 
      "CD",
      "8T",
      "LP"
    ],
    "gold": true
  }
  {"artist": "Led Zeppelin",
  "title": "In Through The Out Door",
  "release_year": 1979,
  "formats": ["CD", "Cassette", "LP"],
  "gold": true // Add record here
  }
];

Your browser information:

User Agent is: Chrome/68.0.3440.75 .

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/manipulating-complex-objects

My first question is, what is myMusic?

It’s an object , (why does this reply post need 20 characters?)

that’s actually wrong. myMusic is not an object.

And i don’t know why it needs 20 characters. Nobody is going to spam that much on this forum anyways. lol

myMusic is an array of objects.

hold on, I didn’t read the whole challenge.

Let me rollback my statement

"This is an array which contains one object inside. The object has various pieces of metadata about an album. " You’re right but where and what is the object? I’m seeing properties of an object such as “artist”: “Billy Joel” where “Billy Joel” is the value and “artist” is the property. But where is the actual object?

objects are wrapped around by curly brackets like { }.

But that’s not the main issue. The problem is that myMusic an array. Elements in a array are separated by commas. Check to see if you’ve properly separated your array’s elements.

You’re awesome! All I needed was a comma between the objects! I wasn’t sure what the objects were in that array, but now I do. Thanks!

1 Like