Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
When to use const or let #1645
When to use const or let #1645
Comments
|
A good idea. Could you make a PR with such addition? |
|
Hey @iliakan , can I work on this? |
|
Here's an excerpt:
Surely you can try to improve the article, @icncsx! |
|
Is it also worth mentioning compiler optimisations that may occur with different variable types? I like what you have there already @iliakan , just wondering if it might be appropriate to add speed considerations as well. |
|
An article about optimizations and internals of JS engines could be useful. |
https://javascript.info/variables
I think it would be good to indicate which is more preferred, i.e. instead of just saying what it does, adding the when to use will be better. For example const would be preferred/recommend whenever possible because you can't modify the value by accident or prevent some other programmer from reusing it for other stuffs and it helps with debugging in the long run. It is not mainly just for constants most of the time, the article worded it out to be that way. Maybe under best practices section or something?