In the answers to this question, we read that function f() {} defines the name locally, while [var] f = function() {} defines it globally. That makes p
function f() {}
[var] f = function() {}
The simplest explanation:
function aaaaaaa(){
Can be used before it is declarated:
aaaaaaa(); function aaaaaaa(){ }
But this doesn't work:
aaaaaaa(); aaaaaaa=function(){ }
That's because in the third code, you are assigning aaaaaaa to an anonymous function, not declaring it as a function.