3 ms·
>> "If you want a function to call itself..." Or just use the arguments.callee property which allows you to call the function from itself without worrying abou
by axod 17y ago
>> "If you want a function to call itself..."
Or just use the arguments.callee property which allows you to call the function from itself without worrying about names.
edit: oops, just seen that's on a later slide.
- tlrobinson 17y agoExcept in ES5 strict mode :-/
- gb 17y agoYou can still do it, and without a Y combinator or anything like that too: var ninja = { yell: function () { var yellLocal = function(n) { return n > 0 ? yellLocal(n-1) + "a" : "hiy"; } return yellLocal; }() }