var foo;
...
foo = function() {
}
Also another difference in the latter is that its an anonymous function, which is commonly seen in assignment expressions — but you could also name it for more informative logging. var foo = function realName(){};