CodeGuide
CodeGuide copied to clipboard
javascript 中关于空行的规范
// need blank line after blocks
var obj = {
foo: function() {
return 1;
},
bar: function() {
return 2;
}
};
// not need blank line when in argument list, array, object
var foo = {
a: 2,
b: function() {
a++;
},
c: 3
};
为什么第一个obj.foo 后面加空行,第二个foo.b后面又没有?