What's the difference in those declarations (in JavaScript)?

Posted by alexeypro on Stack Overflow See other posts from Stack Overflow or by alexeypro
Published on 2010-04-27T05:02:45Z Indexed on 2010/04/27 5:13 UTC
Read the original article Hit count: 251

Filed under:

In Javascript I can write:

function TheFunc(arg) {
   ...
}

or

TheFunc = function(arg) {
   ...
}

or

TheFunc : function(arg) {
   ...
}

What's the real difference and when should I use which?

© Stack Overflow or respective owner

Related posts about JavaScript