JavaScript function declaration and evaluation order
问题 Why does the first one of these examples not work, but all the other ones do? // 1 - does not work (function() { setTimeout(someFunction1, 10); var someFunction1 = function() { alert(\'here1\'); }; })(); // 2 (function() { setTimeout(someFunction2, 10); function someFunction2() { alert(\'here2\'); } })(); // 3 (function() { setTimeout(function() { someFunction3(); }, 10); var someFunction3 = function() { alert(\'here3\'); }; })(); // 4 (function() { setTimeout(function() { someFunction4(); },