Self-recursion and arrow functions

Claus Reinke claus.reinke at
Sun Mar 17 02:43:31 PDT 2013

> I understand, but it's still a limitation of arrow functions that they rely
> on arguments.callee to self-reference. Relying on the defined name
> they're assigned to suffers from the "can be redefined" problem. NFE's
> don't suffer this problem and can completely avoid `arguments` in ES6
> for all use cases Arrow functions, currently, cannot.

Neither arguments.callee (not available in strict) nor let (clumsy to
use in expressions) are needed for self-reference

    var rec = (f) => f((...args)=>rec(f)(...args));

    var f = (self)=>(n)=> n>1 ? n*self(n-1) : n;


You can try it out in traceur (example link at the bottom)



More information about the es-discuss mailing list