Kablamo Interview Question: What are Promises and what do... | Glassdoor

Interview Question

Senior Front End Engineer Interview Melbourne (Australia)

What are Promises and what do they solve?

Answer

Interview Answer

1 Answer

0

A Promise is an object that represents the state of an asynchronous task (completion, failure or pending). Callbacks can be attached to this object using the chainable .then() function.

This solves the 'callback hell' nesting problem notable in classic function-based asynchronous tasks, and enables us to compose by chaining multiple callbacks rather than nesting them.

Promises also guarantee callback execution, regardless of success or failure.

Mo Kargas on Jul 9, 2019

Add Answers or Comments

To comment on this, Sign In or Sign Up.