[Manipulating Complex Objects]

[Manipulating Complex Objects]
0.0 0

#1

What is going wrong with that code;

Your code so far


var myMusic = [
  {
    "artist": "Billy Joel",
    "title": "Piano Man",
    "release_year": 1973,
    "formats": [ 
      "CD",
      "8T",
      "LP"
    ],
    "gold": true
  },
  // Add record here
   {
     "artist" : "2pac",
     "title" : "All Eyes On Me",
     "release_year" : 1993,
     "formates"  : [
       "CS",
       "LP",
       "MP3"
     ]
   }
];

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

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


#2

You have a typo here. Look at the spelling of the array in the first object.


#3

What typo i have wrong because i don’t understand


#4

myMusic[1] should contain a formats property which is an array
Cannot read property ‘every’ of undefined

It tell me that below my code.


#5

Did you fix the typo I mentioned? If so, please paste your current code into a reply to this thread, so we can take a look at what the issue is.


#6

var myMusic = [
{
“artist”: “Billy Joel”,
“title”: “Piano Man”,
“release_year”: 1973,
“formats”: [
“CD”,
“8T”,
“LP”
],
“gold”: true
},
// Add record here
{
“artist” : “2pac”,
“title” : “All Eyes On Me”,
“release_year” : 1993,
“formates”: [
“CS”,
“LP”,
“MP3”
]
}
];

this is my code so far but i don’t no what is going wrong.


#7

You still have the same typo I mentioned in my first reply. Read the instructions very carefully and make sure you are correctly spelling the required property names for the second object.


#8

var myMusic = [
{
“artist”: “Billy Joel”,
“title”: “Piano Man”,
“release_year”: 1973,
“formats”: [
“CS”,
“8T”,
“LP” ],
“gold”: true
}
];// Add record here
myMusic.push(
{“artist”: “2pac”,
“title”: “All Eyes on Me”,
“release_year”: 1984,
“formats”: [
“CD”, “Cassette”, “LP”]
}
);

That i believe it is right