JS Coding Questions Logo
JS Coding Questions
#107💼 Interview💻 Code

What is the use of setTimeout

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 Coding

Advertisement

728x90
107of476