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 trialChris Rennie
5,379 Pointsworks in console but not in challenge
//var statement = 'She said \"How\'s the family?\" ' ; //var statement = "She said \"How's the family?\" "; //var statement = "She said \"How\'s the family?\" "; //var statement = 'She said "How\'s the family?\" '; //var statement = 'She said \"How\'s the family?\" ';
Each case above works fine in the console but receives errors during the challenge. What did I miss?
2 Answers
Stone Preston
42,016 Pointslooks like you might have a space at the very end of the string. try
var statement = 'She said \"How\'s the family?\"';
whereas you had
var statement = 'She said \"How\'s the family?\" ' ;
notice the space at the end between the last " and ';. Thats whats causing it to fail
Chris Rennie
5,379 PointsThanks, that makes sense.
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHi Chris,
For future reference, since you wrapped the string with single quotes you only have to escape the single quote.