mirror of
https://github.com/alrayyes/wiki.git
synced 2024-12-01 15:26:23 +00:00
507 B
507 B
id | title |
---|---|
1cd276d1-1af0-4472-aec6-bfd148cb5361 | JavaScript 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
}
});