1

I'm taking a code academy course on Javascript.

Code Academy writes functions in two different ways. Which one is more advantageous?

In the more basic lessons, they wrote functions like this:

var list = function() {

};

Then in more advanced lessons, we wrote functions like this:

function list() {

}
  • @DavidThomas there is small difference – vittore Mar 27 '13 at 22:06
  • @DavidThomas - That's a bit of a risky statement... try invoking a function expression before the assignment occurs. – James Allardice Mar 27 '13 at 22:07
  • There are **many many** similar questions on this site. Please check out some of those rather than asking the same thing..... _again_. – jahroy Mar 27 '13 at 22:08
  • @James: I take your point (and original comment deleted), but it matters only under very limited circumstances and, honestly, it's never really caused me (ymmv, obviously) any troubles so long as I remember what I'm doing. – David says reinstate Monica Mar 27 '13 at 22:09

0 Answers0