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

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: