
Implement JavaScript's setInterval using setTimeout
I was in a job interview pair programming session where I was asked to implement JavaScript’s setInterval method without using setInterval itself. I did poorly at that interview for many reasons, including not knowing how to implement this. The Question Implement the setInterval function in such a way that executing new SetInterval.prototype.start will start the function passed to it and run the function at intervals interval milliseconds until the SetInterval.prototype.clear method is called....