Consider using let instead of var
See original GitHub issueJust a query, shouldn’t we consider migrating over to let
instead of var
for some JS like this:
https://getbootstrap.com/docs/4.1/getting-started/browsers-devices/#select-menu
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Use 'let' and 'const' instead of 'var' - Evert Pot
var uses something called 'hoisting', which can lead to unexpected results. · let and const are both block-scoped. Which means you can declare ......
Read more >let - JavaScript - MDN Web Docs
let allows you to declare variables that are limited to the scope of a block statement, or expression on which it is used,...
Read more >Should I use let or var when implementing a singleton?
There is no difference between let or var, when we are talking about singleton implementation. I have already checked it in my IDE....
Read more >Const vs Let vs Var in Javascript. Which One Should You Use?
The main difference between the two though is that let deals with block scope whereas var deals with global scope or function scope...
Read more >When should I use const and let instead of var in Javascript?
Secondly, different rules apply for scoping. Since let attaches to the scope of whatever block {…}. Use let ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
According to Can I Use see: https://caniuse.com/#feat=let We cannot use
let
in IE 10, and we’re still compatible with IE 10 so it’ll give a wrong direction for our users.But in a next major release we should change that for sure 👍
@SuperPat45 we won’t support IE 10 in v5 only IE 11