DEV Community

Discussion on: Promise Explained like I'm 5.

Collapse
 
jcuffe profile image
Jared Cuffe

You're on the right track - to expand on your metaphor, we're going to add another concept: paying for the pizza!

In your first example, when you go to order the pizza, you have to stand there and wait for the pizza to be made so that you can pay for it and leave.

When you call the pizza for delivery, though, you can go off and do other things while the pizza is being made, and when the pizza arrives at your door, you are able to pay for it then!

So, in both cases, you are waiting for your pizza to be made, so that you can pay for it. With promises, you can do other things, like clean your house, while the pizza is being made, and you are still able to pay for it just as quickly as you would have if you had sat in the shop watching it cook!