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
Christopher Floyd
Courses Plus Student 4,748 PointsI feel as though there was a missed opportunity (however trivial) @ 33sec
I did some research and tested it out and, you can use reserved JS keywords IN your variable names, just not ONLY as your variable name. ex var myVar = works just fine.
1 Answer
Steven Parker
243,160 PointsYou're quite right, identifiers are always handled whole, never broken into parts.
And taking the concept even further, since JavaScript is case-sensitive, versions of keywords with different capitalization are also usable as identifiers (though it might not be a good idea because it could be confusing to read and maintain). For example: "var Var = 3;" is perfectly legal.
Christopher Floyd
Courses Plus Student 4,748 PointsChristopher Floyd
Courses Plus Student 4,748 PointsThank you for the added insight!
Steven Parker
243,160 PointsSteven Parker
243,160 PointsChristopher Floyd — Glad to help. You can mark a question solved by choosing a "best answer".
And happy coding!