mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-25 13:06:22 +00:00
433 B
433 B
id | title |
---|---|
e059aba7-2912-4a54-8c04-dbb6fbd3d0a7 | Producing Promises |
Advice
Use Async functions instead of this.
Syntax
const p = new Promise(
function (resolve, reject) { // (A)
if (true /* replace true with your own logic */) {
resolve(value); // success
} else {
reject(reason); // failure
}
});