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

Alex Warner
PLUS
Alex Warner
Courses Plus Student 4,987 Points

Bug? The code challenge is asking my to create an empty JavaScript array which should be var myArray = [];

The first step is to create an empty JavaScript array. There's no instruction as far as what to call it. I'm entering var songs = []; and it's returning an error.

songs.json
var songs = [];

You're creating an array called "songs". Try changing that to myArray.

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! No, it's not a bug. Take a look at the file name. It's "songs.json". This is not a JavaScript file, this is a JSON file. There is no variable declaration nor semicolon needed. The only thing needed here is an empty set of square brackets.

Hope this helps! :sparkles: