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

Challenge question that asks message variable be valued at ‘Java’ ‘Script’. Getting error that this command won’t work.

Understand it is a restriction with the language—— how do we get pass this question?

Steven Parker
Steven Parker
231,154 Points

Can you provide a link to the course page you are working with? And be sure to show your code as well.

3 Answers

Thanks Steven

It is a fill in the blank question within the Review Concatenation quiz in the Storing and Tracking information with variables.

The question asks to name the variable “message” and follow it up with a “Java” string with the “Script” final block filled in. When I go to do it, there is an outside message prompt that the program doesn’t recognize the name Java..... as a work around, I attempted to block it with a \, but that just got me the traditional red x.

Steven Parker
Steven Parker
231,154 Points

Normally, you'd only select a "best answer" once your issue has been resolved. :wink:

Steven Parker
Steven Parker
231,154 Points

I dug around a bit and think I found your page at this link.

The question asks: "Complete the code below to create a new variable named message containing the string "JavaScript"" and it shows:   var ____ = ____ + 'Script';

I'm guessing the issue is quoting. The first blank definitely needs  message  (no quotes), but the second one needs  'Java'  (with the quotes). I suspect you originally entered Java with no quotes, which would cause it to be an undefined identifier.

Steven Parker
Steven Parker
231,154 Points

It looks like your keyboard generated word-processing ("curly") quotes instead of the normal kind used in programming. Here's examples of both enlarged, see if you can see the difference:

curly quotes :point_right: '‘Java’' vs. "Java" :point_left: normal quotes

You can also use an apostrophe ("single quote") around strings, you might try that.

I‘ve just gone to the quiz and typed in the quotation marks to verify that this is still occurring. Got the following message:

Oh no! The following answers you gave have characters that cannot be used in answers: '‘Java’'. Please try again.

If you continue experiencing problems, please contact support at help@teamtreehouse.com

———————- Recommend that this question be adapted with new values avoiding “JavaScript”.

Steven Parker
Steven Parker
231,154 Points

See the comment I added to my answer. :arrow_heading_up:
If that resolves the issue, you can mark it as "best answer". :wink: