Advertisement
728x90
The setInterval() method is used to call a function or evaluate an expression at specified intervals (in milliseconds). For example, let's log a message after 2 seconds using setInterval method,
javascript
1setInterval(function () {
2 console.log("Good morning");
3 }, 2000);Advertisement
Responsive Ad
🎯 Practice NowRelated Challenge
JavaScript Coding Exercise 23
Test your knowledge with this interactive coding challenge.
Start CodingAdvertisement
728x90
108of476