98-375 · Question #103
Which code fragment sets up a timer that calls a function named "adjust" every second?
The correct answer is D. setInterval(adjust, 1000). The setInterval() method calls a function at specified intervals in milliseconds until clearInterval() is called or the window is closed. Incorrect Answers: A, B: The setTimeout() method calls a function after a specified number of milliseconds. C: The setInterval() method is…
Question
Which code fragment sets up a timer that calls a function named "adjust" every second?
Options
- AsetTimeout(adjust, 1);
- BsetTimeout(adjust, 1000);
- CsetInterval(adjust, 1);
- DsetInterval(adjust, 1000);
How the community answered
(24 responses)- A8% (2)
- B4% (1)
- C4% (1)
- D83% (20)
Explanation
The setInterval() method calls a function at specified intervals in milliseconds until clearInterval() is called or the window is closed. Incorrect Answers: A, B: The setTimeout() method calls a function after a specified number of milliseconds. C: The setInterval() method is specified in milliseconds.
Topics
Community Discussion
No community discussion yet for this question.