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

Łukasz Czuliński
Łukasz Czuliński
8,646 Points

'AJAX Basics' challenge: what am I missing?

I feel pretty foolish here as I'm sure this is quite trivial.

"In this challenge, you'll create a JSON file containing a string that's formatted as an array of JavaScript objects. The file will contain an array of songs, each with a song title and artist. Start by creating an empty array."

I have tried:

var empty = new Array();
[];
[{}];

I somehow can't find this even after a few Googles.

6 Answers

Hugo Paz
Hugo Paz
15,622 Points

Second one but remove the semi-colon. So its just []

Łukasz Czuliński
Łukasz Czuliński
8,646 Points

Thank you sir! I knew it was going to be something like that.

Christian Linnerud
Christian Linnerud
7,312 Points

["empty array"] //If you paste this you will pass task 1 of 4.

[]

Laura Rodriguez
Laura Rodriguez
8,284 Points

After long time looking the mistake I got it!

[{"title": "Shakira","artist":"Wakawaka"}]

:D

Tom Nguyen
Tom Nguyen
33,501 Points

This is what I used to pass:

songs.json
[
{ 
  "title" : "song_title" ,
  "artist" : "artist_name"
}
]

Its only the [] without semi colon