Home > other >  Is a promise an API of the browser or a JavaScript object?
Is a promise an API of the browser or a JavaScript object?

Time:11-13

The Document object or the SetTimeout function I understand are web API’s that are included in the JavaScript runtime, whereas an Array or Date object is built into the programming language itself. Where do promises fit? Are they part of a browser Api or are they are part of the JavaScript language that run in the js engine!? Online sources are confusing me! Thanks

CodePudding user response:

Promises are JavaScript objects. They're documented in the EcmaScript specification.

There's nothing browser-specific about promises, and they're implemented in node.js, not just browsers.

  • Related