Function placement point in var -JS

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?*/
}
+3
source share
2 answers

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/

+1
source

This question (and the accepted answer) is probably what you are looking for.

0
source

All Articles