This is a function declaration vs a function expression issue. To some degree it's a stylistic choice. What you do need to be aware of is that function declarations get hoisted by the JS interpreter, which function expressions aren't. Some people prefer to use function expressions because they don't like the idea of their code being rearranged.
You might want to check out:
var functionName = function() {} vs function functionName() {} http://javascriptweblog.wordpress.com/2010/07/06/function-declarations-vs-function-expressions/ http://www.adequatelygood.com/JavaScript-Scoping-and-Hoisting.html