nerdexam
Microsoft

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…

Understanding JavaScript

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)
  • A
    8% (2)
  • B
    4% (1)
  • C
    4% (1)
  • D
    83% (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

#setInterval#setTimeout#timers#JavaScript timing

Community Discussion

No community discussion yet for this question.

Full 98-375 Practice