Run
Online Code Editor
setTimeout() method
Hello World :) :)
This is an example of using the setTimeout() method
Here, a new tab will open after 2 seconds and close after 2 seconds.