4 ms·
This is why I really dislike it when I see var a = "foo", b = "bar", c = "baz"; All it takes is one missed comma and all of a sudden you'v
by mnutt 15y ago
This is why I really dislike it when I see
var a = "foo",
b = "bar",
c = "baz";
All it takes is one missed comma and all of a sudden you've turned a lot of your variables global.
- fuzzythinker 15y agothat's why many people favor this variant: var a = "foo" , b = "bar" , c = "baz" ;
- webXL 15y agoI see this hideous convention used a lot when assigning nodejs modules, so you can easily comment out modules for debugging purposes (I think). Other than that, why is "[NL], b = 1" safer or better than "b = 1,[NL]"?
- mnutt 15y agoThat makes the commas easier to see (and is ugly IMO) but it's still one comma away from making the rest of your variables global. What's so bad about just var a = "foo"; var b = "bar"; var c = "baz";