DEV Community

 Rahul Gupta
Rahul Gupta

Posted on

2 1

Use of setTimeout method in Javascript

The setTimeout() method is used to call a function or evaluate an expression after a specified number of milliseconds.

An example of code below will log a message after 2 seconds using setTimeout method:

setTimeout(function () {
console.log("The Coding Dev");
}, 2000);

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay