作者:鄙人嘘嘘_594 | 来源:互联网 | 2023-07-10 10:18
This question already has an answer here:
这个问题在这里已有答案:
- What is the use case for var in ES6? 4 answers
ES6中var的用例是什么? 4个答案
Now that we can write ES6 and deploy it to browsers (using Traceur or 6to5 to support legacy user agents), is there any reason why we wouldn't use let
or const
as our default keywords for variable declaration?
现在我们可以编写ES6并将其部署到浏览器(使用Traceur或6to5来支持传统的用户代理),我们有什么理由不使用let或const作为变量声明的默认关键字吗?
Is var
dead? And if it is, can I configure my linting tools to reject it?
var死了吗?如果是,我可以配置我的linting工具来拒绝吗?
3 个解决方案