News for hackers. Stuff that matters.
Re:JavaScript Patterns Collection by drostie on Monday March 18, 2013 @08:41AM (#5393736)
Also, aside from hoisting, there is a much better solution for named+assigned function declarations, because the reason for naming such a function is to use it recursively. Hence, just use the verb form of the word "recurse" and it immediately self-documents that the function is recursive:

    var fibs = function recurse(n, curr, last) {
        curr = curr || 1;
        last = last || 0;
        return n <= 0 ? last : recurse(n - 1, curr + last, curr);
    };
Re:JavaScript Patterns Collection by kaoD on Monday March 18, 2013 @11:14AM (#5394652)
Good luck with your stack traces.