Trouble with Manipulating Complex Objects

Trouble with Manipulating Complex Objects
0.0 0

#1

Tell us what’s happening:

hello everyone, I’m having a hard time figuring out this challenge. I’m supposed to add a new album to this complex object.

Your code so far

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6.

Link to the challenge:


#2

You essentially want to add an new entry to the myMusic array:

var myMusic = [{
    album1
},
{   
    album2
}
];

Start by thinking about what needs be the same as the current album (“Billy Joel”), include them in the second album object and then add in the new details to make the record a new album.

(HINT: The new album is going to look very similar to the first album) :slightly_smiling_face:


#3

Thank you so much. The problem was that I forgot to put in the comma after the first set of curly brackets. Thanks again.


#4

No Problem- some of the little syntax points are not all that obvious at first!