开发者

Point of putting a function in a var -JS [duplicate]

This question alre开发者_StackOverflow社区ady has answers here: Closed 11 years ago.

Possible Duplicate:

Javascript: var functionName = function() {} vs function functionName() {}

What's the point of putting a function in a var or not?

var varFunc = function () {/*cool code*/};
function plainFunc() {
    /*cooler code?*/
}


Assigning a function to a variable, aka anonymous functions, can be pretty useful once you know what they do.

Check this out - http://helephant.com/2008/08/23/javascript-anonymous-functions/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜