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!
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

Pedro Orellana
Courses Plus Student 835 PointsCan we use "const, let" to define variables instead of using var? Is there a video that explains we can also use them?
A course in another site implemented the use of 'const' and 'let' right away and did not use 'var' to define variables. I know this is used in the newest version of JS. I'm new to Treehouse and wanted to know if theres a video that also explains we can use const and let. Thanks!
3 Answers

tomd
16,701 PointsHello Pedro. I recommend watching this video, https://teamtreehouse.com/library/introducing-es2015
And then practice with these workshops
https://teamtreehouse.com/library/defining-variables-with-let-and-const https://teamtreehouse.com/library/practice-let-and-const-in-javascript

Jason Anders
Treehouse Moderator 145,840 PointsHi Pedro,
There is a Workshop that introduces const
and let
.
I would recommend, however, that if you are going through the older JS course, you may want to stick with var
in the challenges, as the code checkers may not be updated to the new syntax. What may, in fact, be correct and current syntax may result in a Bummer!
in an older course's challenge.
Hope that helps! :)

Mike Hatch
14,940 PointsThis sounds like a case of too many courses at once creating a conflated confusion.
Wes Bos's article on the topic helped me understand the big picture behind the current state of var, let and const. (You may want to read his let
and const
article while you're at it.) What this particular article helped me understand is that even at the top of the Web Developer Food Chain, the opinions and choices can vary widely.
A rich history of the languages is important for us to know in the future to understand older tech. Old tech will remain. There's old tech and there's new tech. var
= old tech. let
= new tech.
Pedro Orellana
Courses Plus Student 835 PointsPedro Orellana
Courses Plus Student 835 PointsPerfect, thanks!