Possible duplicate:Javascript: var functionName = function () {} vs function functionName () {}
What is the point of putting a function in var or not?
var varFunc = function () {/*cool code*/}; function plainFunc() { /*cooler code?*/ }
Assigning a function to a variable known as anonymous functions can be very useful when you know what they are doing.
Check it out - http://helephant.com/2008/08/23/javascript-anonymous-functions/
This question (and the accepted answer) is probably what you are looking for.