I saw, very often in fact, it is quoted as saying why use the K & R style when writing ECMAScript.
function foo () {
return
{
foo: 1
}
;
}
This does not work in ECMAScript or Javascript: merging with an implicit semicolon results in a function return undefined. However, I see it all the time too
function bar () {
var a = "BAR";
return a
.toLowerCase()
;
}
And I wonder why implicit semicolons do not result in a return "BAR", why does it return bar?
source
share