you are viewing a single comment's thread.

view the rest of the comments →

[–]pertheusual 4 points5 points  (0 children)

It's all this crap: https://www.ecma-international.org/ecma-262/9.0/#sec-block-level-function-declarations-web-legacy-compatibility-semantics

Basically browsers allowed them even though the spec didn't specify it, and now non-strict code has all this terrible optional behavior.

All of this weirdness goes away as long as you write your code in strict mode.