0
2
llucycodes42
Promise is an API and abstraction for asynchronous tasks. It allows you to make a statement like "I will do X when Y happens" without needing to use any expressions. This is a constructor for a new Promise object. The first argument is a function that takes two arguments: resolve and reject. The Promise will call this function when the promise is fulfilled or rejected.
Shortcut: prom
return new Promise((resolve, reject) => { first })