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.

JavaScript JavaScript Basics (Retired) Making Decisions with Conditional Statements Boolean Values

Rouillie Wilkerson
Rouillie Wilkerson
10,419 Points

Why var when let is currently being used?

We are being taught to start a variable with "var", when every other source is telling us to switch to "let"? Is there an updated course available?

Rouillie Wilkerson You can use any of them. It still is supported. I do believe there is an updated one about to come out, so maybe in there they will require it. Its good you caught that and code with all of them. I been doing it every way and it has worked for the most part.

1 Answer

Hey Rouillie Wilkerson,

That’s a great question! You are right, most of the videos you watch will use let or const. And there are definitely some differences between them. I believe the reason you’re seeing var in some of the videos is simply due to the age of the recording. That being said, what you’re learning is still applicable.

If you’re just getting started with JavaScript, I wouldn’t stress over it too much. But if you want to dive deeper into the differences, here’s a very popular Stack Overflow thread on the topic. It’s a popular question!

Happy coding!