Hardcore developers of any language are generally very opinionated when it comes to the specifics of how they code. In the JavaScript community, one subject of heated debate is whether to use the `var` keyword once and separate declarations by line:
对于任何一种语言的铁杆开发人员,在编写代码的细节方面通常都会很自以为是。 在JavaScript社区中,引起激烈争论的一个话题是是否使用一次var关键字并按行分开声明:
var one = 1, two = 2, three = 3;or use the `var` keyword many times, one declaration per line:
或多次使用`var`关键字,每行一个声明:
var one = 1; var two = 2; var three = 3;The question is...what do you prefer?
问题是...您更喜欢什么?
演示地址
翻译自: https://davidwalsh.name/javascript-var
相关资源:jdk-8u281-windows-x64.exe