LearnFrenzy
Sign in Take a free test

Functions · JavaScript Functions MCQ · Question 14

What is a callback? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 14 Back to Exercise

In setTimeout(showAlert, 1000), what is showAlert?

  • A A return value
  • B A promise
  • C A callback – a function passed to another function to be called later Correct
  • D An event
Correct Answer: Option C

setTimeout calls showAlert after the delay. Writing showAlert() would call it immediately and pass its result instead.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links