Calling a function after time interval in javascript

If you wanted to do some stuff after time interval so here is the solution for you.

Here setInterval() method will call test() method after each 2 seconds.

Share This: