Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript AJAX Basics (retiring) Programming AJAX Finish the JSON File

how to add the song objects to the JSON

Can someone help me on how to remove the extra comma i am told to remove after running my code. Can't find it.

songs.json
[ 
  {
    "title" : "My Way",
    "artist" : "Frank Sinatra"
  },
]
[ 
  {
    "title" : "My Love",
    "artist" : "Leo"
  },
]
[ 
  {
    "title" : "Victory",
    "artist" : "Kelly"
  },
]
[ 
  {
    "title" : "Go",
    "artist" : "2pack"
  }
]

1 Answer

You're really close on this one, you need to have the objects in ONE Array, and separate the objects by using a comma, Here you are using an array per object:

 [ 
  {
    "title" : "My Way",
    "artist" : "Frank Sinatra"
  }, 
  {
    "title" : "My Love",
    "artist" : "Leo"
  }, 
  {
    "title" : "Victory",
    "artist" : "Kelly"
  },
  {
    "title" : "Go",
    "artist" : "2pack"
  }
]