Manipulating Complex Objects Help Needed

Tell us what’s happening:
I have no idea what to do here. Do I copy and paste and put another item under the var?

Your code so far

var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ 
      "CS", 
      "8T", 
      "LP" ],
    "gold": true
  }
  // Add record here

 {
    "artist": "Elton John",
    "title": "Rocket Man",
    "release_year": 1979,
    "formats": [ 
      "CS", 
      "8T", 
      "LP" ],
    "gold": true
  }
];

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/manipulating-complex-objects

You have the right idea but there is a syntax error.

Re-read the “Note” part:
You will need to place a comma after every object in the array, unless it is the last object in the array.

I did, I copied the format exactly how the computer did it. Not sure what it is I’m still missing.

Remember that arrays have elements which are separated by commas. You have an array of elements where the elements are objects.

Yes, the individual objects are correct. It’s the array that is the problem.

An array of numbers would look like this:
[1, 2, 3, 4]
with each item separated from the previous one by a comma.

An array of objects would also have items separated by commas:
[{}, {}, {}]
(I used empty objects to make it easier to read)

1 Like