I was going through this code :
https://raw.githubusercontent.com/douglascrockford/JSON-js/master/json_parse.js
All functions in this file are defined as
var foo = function() {}
instead of
function foo(){}
I am quiet aware of what each style represents and how to use them. However I am yet to see a convincing answer on what the advantage of using the first pattern over the second one is.
Is it just because.. "functions are first class objects .. they can be assigned and tossed around.. so why not??"
or is there some solid reason behind this ?