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 Create a JSON file

Why is this code not running?

This is the error message I get! Bummer! Try again; there seems to be a problem with your JSON! Error: 757: unexpected token at '"songs" : []'

songs.json
 "songs" : []

5 Answers

Muhammad Fitri
Muhammad Fitri
5,018 Points

It said first "start with empty array", so just put array, []

Yes, that worked!

Yes, that worked!

Yes, just placing an emply array [] was the right way to proceed to the task.

Darren Joy
Darren Joy
19,573 Points

Not sure what you are trying to do here: Can you throw down some info or code on what the exercise is?

Darren Joy
Darren Joy
19,573 Points

If, as Muhammad said it's creating an empty string, then "songs" : (colon) [] won't do it.

You need to define 'something' as the empty array, more like this....

something = (equals) 'empty array'

the empty square brackets should work for the empty array, it's the "songs" : part that doesn't look right.

Also, "" (quotation marks) usually denote the contents of a string. If you are defining the array you wouldn't use "" around it's name to create it

Darren Joy
Darren Joy
19,573 Points

Just adding that I went back and looked at the assignment. My info was about creating an array for a javascript file.

The question pertained to creating a JSON file with the .json extension...

No need to define variables there... as M Fitri said