/callbacksPromises

This describes how you can control flow of JS code execution with callbacks and promises.

Primary LanguageJavaScript

callbacksPromises

This describes how you can control flow of JS code execution with callbacks and promises.

When you can more than a couple of actions will callback s you will end up with a pyramid of doom.

The best solution to this as at now would be promises

Read through the scrips for examples. The image below describes the major difference between both callback and promsies approach of achieving asychronous behaviour with code.

See the differences here : -

Callbacks and promises differences

Reference

https://javascript.info/promise-basics

https://javascript.info/callbacks