In https://javascript.info/function-expressions-arrows#function-declaration-in-a-block
Function declared inside if's body block can execute outside without any problems. Only functions declared inside as variables are not visible outside.
Tested on
- Firefox 54.0.1 x64
- Chrome Version 59.0.3071.115 (Official Build) (64-bit)
Other(clearer) test example https://gist.github.com/Vedaz/335fdf79bfbd39ff86922f96152f8e5f