That's a perfect write-up on this issue. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Klaus Hartl Sent: Thursday, April 12, 2007 11:27 AM To: [EMAIL PROTECTED] Subject: [jQuery] Re: Defining of a function
Mike Alsup schrieb: > > The difference between a function declaration and a function > expression is when the actual "function object" gets created. The > easiest way to think of it is that function declarations are always > available and function expressions are not available until they have > been evaluated. So you can do this: > > x(); > function x() { alert('hi'); } > > but not this: > > x(); > var x = function() { alert('hi'); } > > For details check out: > http://jibbering.com/faq/faq_notes/closures.html > > Mike Dustin blogged about this recently as well: http://www.dustindiaz.com/javascript-function-declaration-ambiguity/ -- Klaus