The relation between thenable object, promise and async/await

If you use libraries like mongoose , knex and some others similar to them — which has kind of chainable methods and also runs asynchronously — you should read this article too.

You might have already heard about thenable object, promise and async/await. If you haven’t or still didn’t get the relation between them, don’t worry we will cover that here completely.

What is “thenable” object?

The definition of thenable object is the simplest thing in the world:

Any object that has a method named “then” is called a “thenable” object.

#web-development #programming #javascript #developer

The Benefit of the Thenable Object in JavaScript
2.95 GEEK