Function declarations inside blocks are illegal, technically, because of hoisting. See <a href="http://kangax.github.io/nfe/#function-declarations-in-blocks" rel="nofollow">http://kangax.github.io/nfe/#function-declarations-in-blocks</a>