Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use const and let over var #31

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

Closed
CodinCat opened this issue Jan 6, 2017 · 4 comments
Closed

Use const and let over var #31

CodinCat opened this issue Jan 6, 2017 · 4 comments

Comments

@CodinCat
Copy link

CodinCat commented Jan 6, 2017

The current code samples are not consistent, mix a half var and a half let (and a few const).

We may need a unified rule for the usage of const/let and apply it to the code samples, as you mentioned in the second principle Use ES6 constants when variable values do not change, or your code is not clean. πŸ˜‰

@ryanmcdermott
Copy link
Owner

Thank you for sussing out the inconsistencies. We do need a coherent stance on this. @ericelliott has a good article about this, to use as inspiration so we could also elaborate more on the ES6 constants section.

@schoenwaldnils
Copy link
Contributor

schoenwaldnils commented Jan 6, 2017

I even just started to edit for a PR, but then there were so much changes to make ^^

I highly recommend this screencast from laracast:
https://laracasts.com/series/es6-cliffsnotes/episodes/3

I personally don't use var anymore and default to const.
And if the value changes, I change it to let.

I could open a PR with my method, if the wish is there.

@ryanmcdermott
Copy link
Owner

@schoenwaldnils has an awesome fix so I'm going to close this issue once that is merged in with minor tweaks. Thanks CodinCat for your help!

@ryanmcdermott
Copy link
Owner

This was addressed in #51. Thanks for all of your help!

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

3 participants