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
On 4/12/07, Olaf Gleba <[EMAIL PROTECTED]> wrote:
Hi,
Maybe i should take a break,- i don't get the point what differences
it makes defining a function as a named or a anonymous function.
function xxx () {
...
}
var xxx = function() {
...
}
What are the advantages and disadvantages of both of them?
Thx in advance.
--
Olaf Gleba