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 Basics (Retired) Storing and Tracking Information with Variables Review Creating and Naming Variables

Why is this not valid? It does not give an explanation.

why is this not valid

Samuel Ferree
Samuel Ferree
31,722 Points

I think you forgot to post the code you're trying to run.

Raymon Oleaga
Raymon Oleaga
19,298 Points

Do you mean the question in that Quiz that is linked at the top...?

var MyVarName = "String or whatever";

Samuel Ferree
Samuel Ferree
31,722 Points

I just took that quiz and didn't see a question asking why

var MyVarName = "String or whatever";

isn't valid.

Sandro Das Neves
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Sandro Das Neves
Front End Web Development Techdegree Graduate 23,426 Points

maybe you should look the video again, with the right answer you have this : Yes you can begin a variable name with $ or _. and var is a reserved word