ja, schön!
so wäre es denke ich erlaubt, weil ? : ja eine Expression ist:
ActionScript:
Function.prototype.loop = function(x) {
x--;
var f = this;
return (x<0) ? null : function () {
f.apply(f, arguments);
f.loop(x).apply(f, arguments);
}
};
und noch ein interessanter Code-Schnipsel:
ActionScript:
Function.prototype.keepArguments=function() {
var f=this;
var args=arguments;
return function() {
return f.apply(f, args);
}
}
z=function(x,y) {
return x*y;
}
z1=z.keepArguments(2,3);
trace(z1());