Manipulating Complex Objects_2

Manipulating Complex Objects_2
0

#1

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


#2

My first question is, what is myMusic?


#3

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


#4

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


#5

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


#6

myMusic is an array of objects.


#7

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

Let me rollback my statement


#8

"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?


#9

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.


#10

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!