Can someone help me - why do we have this behavior in a JS snippet?
var foo = function() { return { hi: console.log("foo") } } var foo1 = function() { return { hi: console.log("foo1") } } foo(); foo1();
Why is only "foo" printed?
fiddle
EDIT ok, this is due to the automatic installation of the semicolon insert, BUT
Do we have some ways to make JS not execute these cases?
I mean, can we do something that will lead to an error here?
EDIT2
Looks like the best deal - JShint - I asked here
source share