// p1 and p2 are the same
const p1 = new Promise(function(resolve, reject) {
reject('Oh no');
});
const p2 = Promise.reject('Oh no');
// p3 and p4 are the same
const p3 = new Promise(function(resolve, reject) {
resolve(42);
});
const p4 = Promise.resolve(42);
Created
June 11, 2018 14:01
-
-
Save amysimmons/0e30397b650307104f0d4917a8500fff to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment