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

SAMUEL LAWRENCE
PLUS
SAMUEL LAWRENCE
Courses Plus Student 8,447 Points

Quiz question has a big mistake

Hi Guys, I'm doing the JavaScript ES6 course,

link https://teamtreehouse.com/library/getting-started-with-es2015-2/defining-variables-with-let-and-const/review-creating-variables-with-const In the create variables with const quiz there is an error which causes you to get an answer wrong even if you're correct.

The question asks Which of the following produces a syntax error?

the choices are A

const days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'];
days.push('Saturday', 'Sunday');

B

const names = [ ];
names [0] = 'Sarah;
names[1] = 'Ryad';
names[2] = 'Nic';

C

const items ['eggs', 'milk', 'coffee'];
items.pop( );
items.pop( );
items.pop( );

D None of the above. The correct answer is supposed to be D.

But the first time I tried the quiz I noticed that names[0] = 'Sarah; is missing the closing single quote, which does not make it a string and therefore will return an error. I know because I wrote the code in my code editor and tried it and it return an error. I'm sure it's a typo but the instructors shoulc fix it. Andrew Chalkley Dave McFarland

4 Answers

Steven Parker
Steven Parker
231,275 Points

Good eye! But you should report this directly to the staff as described on the Support page.

SAMUEL LAWRENCE
SAMUEL LAWRENCE
Courses Plus Student 8,447 Points

I didn't know that's where I should report it. Thanks. In future I will.

Steven Parker
Steven Parker
231,275 Points

Does Sam get an "exterminator" for that? :wink:

Steven Parker
Steven Parker
231,275 Points

Thanks Dave, I just looked too soon at his profile.

SAMUEL LAWRENCE — Welcome to the "club", fellow exterminator! :beetle:

Dave McFarland
Dave McFarland
Treehouse Teacher

ha ha -- no I forgot until you reminded me Steven!

SAMUEL LAWRENCE
SAMUEL LAWRENCE
Courses Plus Student 8,447 Points

Steven Parker thanks, excited to be a member of the exterminator club. Thanks for the badge Dave McFarland . I love Treehouse.

whats the real answer

Steven Parker
Steven Parker
231,275 Points

As Samuel pointed out, the correct answer is "None of these produces an error."

ok