Skip to main content
InterviewHubPRO
Section Overview
Q112

Question 112 of 536

Part 3: DOM, Event Flow, Timers & Browser APIs (104 - 173)

21%
JavaScript & V8 Internals (536 Qs)•Part 3: DOM, Event Flow, Timers & Browser APIs (104 - 173)

What is the use of setInterval

junior LevelCode ExampleHTTP & REST APIs

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
  setInterval(function () {
    console.log("Good morning");
  }, 2000);