The Promise
.prototype
property represents the prototype for the Promise
constructor.
Property attributes of Promise.prototype
| |
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
Promise
instances inherit from Promise.prototype
. You can use the constructor's prototype object to add properties or methods to all Promise
instances.
Promise.prototype.constructor
Promise
function by default.Promise.prototype.catch(onRejected)
Promise.prototype.then(onFulfilled, onRejected)
onFulfilled
or onRejected
is not a function).Promise.prototype.finally(onFinally)
Specification | Status | Comment |
---|---|---|
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'Promise.prototype' in that specification. | Standard | Initial definition. |
ECMAScript Latest Draft (ECMA-262) The definition of 'Promise.prototype' in that specification. | Draft |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 32 | Yes | 29 | No | 19 | 8 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 4.4.3 | 32 | Yes | 29 | Yes | 8 | Yes |
Server | |
---|---|
Node.js | |
Basic support | 0.12 |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/prototype