3 ms·
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'
by ecounysis 16y ago
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.