Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop telling us "let is the new var" #117

Open
hayesmaker opened this issue Feb 20, 2017 · 4 comments
Open

stop telling us "let is the new var" #117

hayesmaker opened this issue Feb 20, 2017 · 4 comments

Comments

@hayesmaker
Copy link

let is not the new var.. they're different things, and var is still useful.

@zchrykng
Copy link

@hayesmaker perhaps you can enlighten us and provide examples. Where var is superiour to const or let.

@getify
Copy link
Contributor

getify commented Feb 20, 2017

I agree with @hayesmaker that we should be using var alongside let (and const) in code. That's what I teach in all my classes and write about in my YDKJS books. Here's some other places I've addressed the topic:

@zchrykng
Copy link

Those are some good points. And I would never say that var should go away completely but rather it should only be used when you specifically need it and the let and const should be used whenever possible as they help prevent fairly common classes of problems. Maybe I am just overly used to block scoping since I have mainly been using C++ and Go recently.

@pielegacy
Copy link

@zchrykng my thoughts exactly, never liked the functionality of var so for me let was a welcome addition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants