DEV Community

Discussion on: Explain JavaScript Promises like I am five.

Collapse
 
joshichinmay profile image
Chinmay Joshi

I get it now...

In fact, we can say that JavaScript arrays are envelopes that have the special property of including multiple values.
Promises are similar. They are envelopes just like arrays are, but the special property they have is they handle future/potential/asynchronous values.

Thanks a lot!

Collapse
 
bennypowers profile image
Benny Powers 🇮🇱🇨🇦

Yup!

The non-eli5 answer is that Promises are (not 100% but basically) monads that encode asynchronous behaviour

Thread Thread
 
joshichinmay profile image
Chinmay Joshi

Got it. :)