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

Which course introduces "constants" in JavaScript?

I'm on the Front End Development track and in the "JavaScript and the DOM" course, Guil uses constants in the lessons but without explaining what they are or how they are used. I've completed every course preceding this one and I can't recall constants ever being introduced. If anyone knows which course introduces constants, I'd really appreciate it.

2 Answers

Steven Parker
Steven Parker
243,656 Points

One source of this information would be this short workshop: Defining Variables with let and const.
It would also be the course Getting Started With ES2015.

Thank you!

Hi Leonardo Tapia,

They are just variables that can't be reassigned, and are declared with let or const instead of var.

I just had a quick look through the JavaScript Basics course and was not able to see it in there (ran a quick search on some of lesson transcripts). I did however find this resource on JavaScript constants which covers them well.

I realise this isn't a link to an internal video but it will provide you with a good understanding of constants.

Happy coding,

Dave.

Oh nice, links are posted!!