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 Basics

James Lees
James Lees
11,225 Points

Possible code checker error

Hi there,

I am trying to submit my code on the code challenge. the challenge asks us to define a variable statement and then the string "She said How's the family?"

I have added the following code and the code checker keeps telling me to add a .

var statement = ' She said "How\'s the family?" ';

I can't work out what is wrong, please help.

Kind Regards,

James

3 Answers

Hi James,

I'm not sure if that is the exact code you put in the challenge or just what you typed on here but you have a leading and trailing space in that string.

Nice catch, Jason. If you copy and paste the code from his post into the challenge, the error comes up.

Forget my answer, Jason Anello is correct, your issue is the leading and trailing spaces.

James Lees
James Lees
11,225 Points

Hey Bryan and Jason, many thanks for your help. I played around with various permutations of the ' and " and eventually got one that worked a little while later. I will note the leading and trailing spaces, good learning. Thanks a lot!