Re: Function Format Question!



RobG wrote:
On Jun 29, 6:26 am, Good Man <h...@xxxxxxxxxx> wrote:
i was wondering if someone could give me a brief
>> explanation as to what the differences are between
function saveFinal(){
versus the second:
saveFinal = function(){
The difference between the two is when the function is created. The
first example is a function declaration, so it will be created when
identifiers are resolved and before any code is executed. The second
is a function expression, so the identifier saveFinal will be created
up front (provided var is used) but the function itself won't be
created until the code is executed.
Rob

Yeah, just like I said, "quite different".

Or did I say there's no difference at all. Who remembers ;-)

Seriously, thanks for that Rob. I was sure I saw Douglas
Crockford say (in one of his videos) that there's virtually
no difference, but that virtually can be quite significant.

~dd
.