Re: Function Format Question!
- From: d d <no_spam@xxxxxxxxxx>
- Date: Fri, 29 Jun 2007 07:44:31 +0200
RobG wrote:
On Jun 29, 6:26 am, Good Man <h...@xxxxxxxxxx> wrote:>> explanation as to what the differences are betweeni was wondering if someone could give me a brief
function saveFinal(){The difference between the two is when the function is created. The
versus the second:
saveFinal = function(){
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
.
- References:
- Function Format Question!
- From: Good Man
- Re: Function Format Question!
- From: RobG
- Function Format Question!
- Prev by Date: Re: Passing information from a document to a standard FORM
- Next by Date: From Dwarak
- Previous by thread: Re: Function Format Question!
- Next by thread: Re: Function Format Question!
- Index(es):