JavaScript hoisting and function name inference
Everything started here.
A friend asked me, why the second declaration is bad while the last one is good? Well, I had no idea! So I did a quick research in order to answer him, also for myself.
Please note that all the explanations below are “IMO”. I don’t know whether they’re correct or not. If I’m wrong, please correct me.
[… some explain here]
Resources:
Function Declarations vs. Function Expressions
http://lucybain.com/blog/2014/hoisting/
http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html
https://github.com/airbnb/javascript/issues/794
https://stackoverflow.com/questions/336859/var-functionname-function-vs-function-functionname
Useful links:
https://github.com/h5bp/Front-end-Developer-Interview-Questions#js