I defined some variables in Javascript:
var aaa = "aaa";
var bbb = "bbb";
var ccc = "ccc";
But my friend says it’s better to define them as:
var aaa = "aaa",
bbb = "bbb",
ccc = "ccc";
Because JsLint will report errors in my code.
I am not sure why we should do this as the second one, since I found that my version is better viewed if the value is very large, for example:
var aaa = {
some1 : 111,
some2 : 222
};
var bbb = {
some1 : 111,
some2 : 222
};
source
share