--- title: Promise.allSettled() slug: Web/JavaScript/Reference/Global_Objects/Promise/allSettled translation_of: Web/JavaScript/Reference/Global_Objects/Promise/allSettled ---

{{JSRef}}

Promise.allSettled() 메소드는 배열이나 별도의 나열 가능한 객체를 통해 나열된 Promise모음이 모두 이행하거나 거부했을 때에 대한 대응을 할 수 있는 Promise 객체를 반환한다.

{{EmbedInteractiveExample("pages/js/promise-allsettled.html")}}

문법

Promise.allSettled(iterable);

인자

iterable
iterable 객체로, 주로 배열({{jsxref("Array")}})을 사용하며, 이들의 요소들은 모두 Promise 객체.

반환 값

실행할 {{jsxref("Promise")}} 객체로 비동기 방식으로 이행(Resolved) 및 거부(Rejected)된 결과의 모음을 담아 인자로 전달된다. 이 때 반환된 Promise 객체의 핸들러는 각 본래 Promise 객체가 담긴 배열을 전달할 것이다.

각 출력 객체는 status 속성을 통해,  fulfilled,상태로 전달되면 value 속성이 전달되고, rejected 상태로 전달 시 reason 속성으로 전달된다. 각 Promise가 어떻게 이행(또는 거부)됐는지 value 속성 및 reason 속성을 통해 알 수 있다.

문서 표준

Specification Status Comment
Promise.allSettled() (TC39 Stage 4 Draft) {{Spec2('ESDraft')}}

지원 브라우저

{{Compat("javascript.builtins.Promise.allSettled")}}

구현 진행 상태

The following table provides a daily implementation status for this feature, because this feature has not yet reached cross-browser stability. The data is generated by running the relevant feature tests in Test262, the standard test suite of JavaScript, in the nightly build, or latest release of each browser's JavaScript engine.

{{EmbedTest262ReportResultsTable("Promise.allSettled")}}

같이 보기