There's an error in your good solution.
window.clearInterval(this.timeoutId);
should be
window.clearTimeout(this.timeoutId);
You use clearInterval with setInterval, and clearTimeout with setTimeout.
You use clearInterval with setInterval, and clearTimeout with setTimeout.
No comments yet.