Quoting Strings

Doesn’t that third example need an end backslash? The previous challenge it had two backslashes…

I’m not sure what you mean. Can you be more specific?

the example shows 'Jake asks Finn, "Hey, let\'s go on an adventure?"';
shouldn’t it be 'Jake asks Finn, "Hey, let\'s go on an adventure?"\'; ?

Nope. That last ' is needed to close the string. It isn’t part of the string content.

Oh I see now. I thought it needed a closing backslash as well because that’s what the previous challenge showed.

Thanks!

The previous challenge shouldn’t have escaped the closing quote either. All strings must end in a quote that matches the opening quote.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.