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.
Jesse DispotoFront End Web Development Techdegree Graduate 14,538 Points
Why is Dave still using var to initialize variables? Shouldn't we be using let and const when initializing variables?
Learning a lot from this JS course. However, I have now switched over to using let and const when working with variables, not var. Why is Dave still using var? I would be a good idea to switch over to let and const now. Where these videos made before 2015? Should this be updated?
Michael Hulet47,843 Points
Judging by the UI in the video, it looks a tad bit on the older side, but the video file's timestamp says that the file was created in April 2017 (
const still weren't insanely well-supported back then iirc). However, even though it's 2019, the
const by default like you're doing now to keep scope clearer and cleaner, but if you want your variable to be hoisted, it's still just fine to use