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 JavaScript Foundations Strings Review of JavaScript Strings

Joseph Tingsanchali
Joseph Tingsanchali
5,262 Points

"Which of the following code snippet would store the string "This isn't my car!" into a variable?" answer is missing.

The answer choices are not correct. Two of them are the same and the correct answer is missing.

2 Answers

Ken Alger
Ken Alger
Treehouse Teacher


After several times through that quiz I came across that question with the following answers available:

A var str = "This isn\'t my car!";

B var str = "This isn't my car!";

C var str = 'This isn\'t my car!';

D var str = 'This isn't my car!';

They are all different, there are either single or double quotes being used, along with the various escape sequences. Of those listed here, only B, the correct answer in my rendition of the quiz, works.

Joseph Tingsanchali
Joseph Tingsanchali
5,262 Points


Ah, I think I didn't look at the answers well enough. In my version I saw two of these:

var str = "This isn\'t my car!";

I understand now. Thanks!