In this lesson, we continue learning about promises in Javascript. Javascript promises allow us to execute some code, once some other code is done running. The promise will either resolve or reject, therefore the promise takes a resolve and reject parameter. In the previous lesson, we learn how to set up a promise and in this lesson, we learn how to add resolve and reject within our promise to either resolve if the promise comes back true or reject if the promise fails. If the promise resolves, then we pass in the resolve function what we want to happen next in our code, if the promise is rejected, we can then do something else, such as throw an error.
javascript promises,js es6 promises,promises in js,promises in javascript,resolve and reject js,
0 Comments