https://github.com/Asabeneh/30-Days-Of-JavaScript/blob/master/18_Day_Promises/18_day_promises.md
- Promises are useful when performing a single asynchronous task
- Promises are based on
resolve and reject, if itresolvesthe.thenexecutes, if itrejectswe.catchthe error - Some APIs already have in-built promises as the the fetch API allowing to directly use
.thenand.catch Async/Await:asyncmake the function a promise, two blocks similar asresolveandreject:tryandcatch, we put theawaitin thetryblock,awaitallows to wait for the execution of a function before performing a task
Vanilla Javascript