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