Manipulating Complex Objects - I have everything but I still can't get it right

Tell us what’s happening:

Your code so far

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

myMusic[1] = [
  {
  "artist": "Pink Floyd",
  "title": "The Wall",
  "release_year": 1965,
  "formats": [ 
    "CD",
    "Cassette",
    "LP"
  ],
  "gold": true
}
];

``` Even though I got the first 3 task done, but every below is a big no, 
I need help for this! thanks!
myMusic[1] should have at least 4 properties
myMusic[1] should contain an artist property which is a string
myMusic[1] should contain a title property which is a string
myMusic[1] should contain a release_year property which is a number
myMusic[1] should contain a formats property which is an array
formats should be an array of strings with at least two elements

**Your browser information:**

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

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

Your myMusic[1] is an array, not an object. It therefor does not have any properties.

1 Like

ok i get your point but on my task list, it gave me a tick on myMusic[1] of being an object.
could i get more hint on that? thanks

An array is a type of object.

errrr i dont quite get it, because now is an object but even have the properties in myMusic[1] array when i run it still say i need to add the properties to myMusic[1]

to address the object in your myMusic[1] since myMusic[1] is an array you should use myMusic[1][0]

it’s also not a good way to add stuff to arrays imo, it allows for arrays with empty values if you mistake the indexes, i think you are supposed to use myMusic.push({“artist”: “Pink Floyd”…}) instead

1 Like