wiki/content/20200911154351-promises.md

1 KiB

id title
14e0ce4b-b4b1-46fe-946a-c519550682ac JavaScript Promises

Introduction

A Promise1 is an asynchronous action that may complete at some point and produce a value. It is able to notify anyone who is interested when its value is available.

let fifteen = Promise.resolve(15);
fifteen.then(value => console.log(`Got ${value}`))

Parallel

Errors

Producing & Consuming

Use Async functions instead of this.

Footnotes