See, that's one of the funny - if not brilliant things - with
Javascript:

a=function(a,b){alert(arguments.length);}
a('foo','bar','baz');

Guess, what arguments.length is?  3! Great, nothing's lost! How
about...

out=function(a,b){return arguments[0]+arguments[1];}('foo','bar');
alert(out);

You guessed right... out alerts as 'foobar' ...declared, anonymous,
invoked and return value assigned... all in one step.


Or, if you want to go really nasty...

x='foo';
y=function(obj){out=[];for(var p in obj)if(typeof(obj[p])=='object')
out.push(arguments.callee(obj[p]));out.push(x);return out;}
(someObject);

Declared, recursive, anoymous, invoked while using closure and return
value assigned... all in one statement!
All honours to Eric Shulman, for explaining this stuff.    ;-)


Tobias.

--

You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=.


Reply via email to