LearnFrenzy
Sign in Take a free test

Promises · Promises MCQ · Question 14

Thenables Answer, explanation & discussion

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

What is a "thenable"?

  • A A promise that has not been created yet
  • B A function that returns then
  • C A promise that can be cancelled
  • D Any object with a then method, which promises and await treat like a promise Correct
Correct Answer: Option D

Promise.resolve({ then(r) { r(42); } }) fulfils with 42. This duck typing lets different promise libraries interoperate.

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