There is no real difference, but the var form allows you to declare-up-use if you have recursive functions.
A simple example:
var func1, func2; func1 = function (count) { count = count - 2; if (count > 0) { func2(count); } } func2 = function (count) { func1(count + 1); } func1(10);
Although
function func1 (count) { count = count - 2; if (count > 0) { func2(count); } } function func2 (count) { func1(count + 1); } func1(10);
quite acceptable. The interpreter will replace him first because of the variable lift.
source share