Promise.prototype
속성은 Promise
생성자의 프로토타입을 나타냅니다.
Property attributes of Promise.prototype |
|
---|---|
Writable | no |
Enumerable | no |
Configurable | no |
설명
Promise
인스턴스는 Promise.prototype
을 상속합니다. 모든 Promise
인스턴스에 속성 또는 메서드를 추가하기 위해 생성자의 프로토타입 객체를 사용할 수 있습니다.
속성
Promise.prototype.constructor
- 인스턴스의 프로토타입을 만드는 함수를 반환합니다. 기본값은
Promise
함수입니다.
메서드
Promise.prototype.catch()
- 프로미스(promise)에 거부 처리기 콜백을 추가하고 호출된 경우 콜백의 반환값 또는 프로미스가 대신 이행된 경우 그 원래 이행(fulfillment)값으로 결정하는(resolving) 새 프로미스를 반환합니다.
Promise.prototype.then()
- 프로미스에 이행 또는 거부 처리기를 추가하고 호출된 처리기의 반환값 또는 프로미스가 처리되지 않은 경우 그 원래 처리된(settled) 값으로 결정하는 새 프로미스를 반환합니다 (즉 관련 처리기
onFulfilled
또는onRejected
가undefined
인 경우). Promise.prototype.finally()
- Appends a handler to the promise, and returns a new promise which is resolved when the original promise is resolved. The handler is called when the promise is settled, whether fulfilled or rejected.
명세
브라우저 호환성
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
No compatibility data found. Please contribute data for "javascript.builtins.Promise.prototype" (depth: 1) to the MDN compatibility data repository.