Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

SeHyun Choi
3,441 PointsWhat is const?
I just finished JavaScript loops array object course and I started this course because it right below it. I don't think I learned about const yet. Did I skip a course? Which course should I take before learning DOM?
4 Answers

Steven Parker
220,450 PointsYou may have started your training with courses developed prior to the ES2015 version of JavaScript.
You can catch up on the newer features with the Getting Started With ES2015 course or the more extensive Introducing ES2015 course.

Owen McComas
8,472 PointsGreat question! a lot of those videos you have been watching so far were recorded before the new syntax came out. 'const' and 'let' are both newer ways used to declare a variable just like var. The details of how they differ and the reasonings for their implementation are explained in this course

Michael Hulet
47,869 PointsAs others have pointed out, the videos you watched were probably recorded before ES2015 was popular, and you should totally go back and watch those that the others recommended. To answer your question directly, though, it's like a variable, but you can't change its value after you define it. In other words, its value is guaranteed to be constant. For example, running this code:
const something = 1;
something = 2;
will result in this error:
TypeError: Attempted to assign to readonly property.

SeHyun Choi
3,441 PointsThank you everyone for your help.
Swan The Human
Full Stack JavaScript Techdegree Student 19,326 PointsSwan The Human
Full Stack JavaScript Techdegree Student 19,326 PointsThey should really add this course as an update in the JS track so people aren't confused as they move along. Some people may not search the questions and see this comment. Also I'm not sure if they add update courses for every time a new es comes out but they should do that as well.