JavaScript features a handy couple of methods of the window object: setTimeout() and setInterval(). These let you run a piece of JavaScript code at some point in the future. In this tutorial we’ll explain how these two methods work, and give some practical examples. setTimeout() window.setTimeout() allows you to specify that a piece of JavaScript code (called an expression) will be run a specified