Question 199 on freecodecamp

Question 199 on freecodecamp
0

#1

Please i need help with the 199 question on freecodecamp. the help isnt there anymore. I’m Stuck Plsssss


#2

Do you have a link to the challenge?

And maybe you can show us what you already tried or tell us what you don’t understand?


#3


#4

How do i add the new album to this list.


#5

Just place a comma between the objects:

var myMusic = [
  {
     // key-value pairs
  },{
    // key-value pairs
  }
];

#6

Do I need to create another variable?


#7

I don’t know the challenge instructions, but I guess you have to add an item to the myMusic array. So, you don’t have to create a new variable.


#8

Thanks alot. YOu Rock. Im through. Im still learning so i get stuck atimes.


#9

You would do yourself a favour by providing the information campers ask for when they are trying to help you. @BenGitter asked for a link to the challenge. The image did not reveal the original challenge. So that means your helpers have to make guesses. Looks like Ben guessed right… this time.

As more general solution, in the example shown, myMusic is an array of objects. When hard coding an array’s contents, the elements are separated by commas.

E.g.


var myArr = [1,2,3];
var myArr2 = ['donkey', 'shrek', 'charming'];
var myArr3 = [ 
  {"car": "Mustang", "hair": "blonde"}, 
  {"car": "Camry"}, 
  {"car": "Pinto", "status": "crisp", "color": "burnt"} ];