2 ms·
You can basically consider `var` to be deprecated. It's old and there's no reason to use it. That said, it will be supported forever because of the need to supp
by ironmagma 6y ago
You can basically consider `var` to be deprecated. It's old and there's no reason to use it. That said, it will be supported forever because of the need to support old browsers and old websites. Modern JS codebases use a linter which will tell you not to use `var`.
The rule is pretty simple: use `const` always, unless you can't because you are doing a reassign, in which case use `let`.