Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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