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 trialChen Coello
862 PointsI don't get it.
What do I do? Either it says "You didn't define the blasted variable" or "You've the string is the incorrect value remember to use \ before "or'.
3 Answers
Jeff Busch
19,287 PointsHi Chen,
I'm going to guess the reason you're not passing the challenge is the quotation marks. Remember they have be in pairs in the correct order. So, if you need quotation marks in your sting to make it grammatically you may have to escape () a quotation mark so JavaScript doesn't get confused. The line She said "How's the family?" is to be assigned to the variable statement. Look at the code below and study the quotation marks. Note the quotation marks before the semicolon, a double quote (") followed by a single quote (').
Jeff
var statement = 'She said "How\'s the family?"';
Nicholas Mejia
23,800 PointsCan you post the question along with your code?
Luke Ayres
6,170 PointsWild stab in the dark (because I had the exact same problem!) is that you're missing a second backslash, because the quotemarks are right at the end of the string it isn't so obvious?
var statement = "She said \"How's the family?\" " ;
Chen Coello
862 PointsChen Coello
862 PointsThanks a lot. That one was hard.