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

Loops and arrays quiz

This code creates an array, but there are two things missing. Fill in the blanks to complete the array. var shopping = "milk", "cookies", "eggs"

Answer should be "[]"

just when I thought i was getting a handle on javascript, apparently according to this quiz, the instructor was lying to me the entire time. smh

5 Answers

Maybe you forgot the semicolon?

var shopping = ["milk", "cookies", "eggs"];
Joel Bardsley
Joel Bardsley
31,258 Points

Hi Rich, I've just been through and found the quiz question you're referring to. Just double checking, have you put both square brackets in the first space or did you open and close them in the separate spaces accordingly? I'm getting no problems proceeding past this question successfully.

clarify? I put []

any help would be great...

var shopping = ["milk", "cookies", "eggs" ]

no the quiz is as follows:This code creates an array, but there are two things missing. Fill in the blanks to complete the array.

var shopping = __________ "milk", "cookies", "eggs" ;

That is just weird.. I really don't know then.

Your screen may have been cutting off the last empty space ___________. This may happen if you resized your screen to a smaller size. Some of TreeHouse's quiz questions aren't entirely reponsive