Re:JavaScript closures and recursion
by ecounysis on Thursday November 25, 2010 @11:48PM
(#1941654)
I like the use of modulo; I hadn't thought of that.
setInterval is definitely much more simple and clean than recursively calling setTimeout, however it doesn't illustrate what is going on under the hood or how setInterval might be implemented.
Writing a Y-combinator isn't the easiest way to write a recursive function, but it does help us learn how recursion really works.
setInterval is definitely much more simple and clean than recursively calling setTimeout, however it doesn't illustrate what is going on under the hood or how setInterval might be implemented.
Writing a Y-combinator isn't the easiest way to write a recursive function, but it does help us learn how recursion really works.