⏳
Promise All
Promise All어려움 비동기 +40pts
Problem
Implement a simplified version of Promise.all.
Examples
Input:
promiseAll([Promise.resolve(1), Promise.resolve(2)])Output:
[1, 2]Explanation
이 문제는 **Promise.all**의 동작 원리를 이해하고 직접 구현하는 방법을 학습합니다. ## 핵심 개념: Promise.all 모든 Promise가 완료될 때까지 기다린 후 결과 배열을 반환합니다. ### 동작 방식 1. 모든 Promise가 성공 → 결과 배열 반환 2. 하나라도 실패 → 즉시 reject ### 구현 분석 ```javascript return new Promise((resolve, reject) => { const results = []; let completed = 0; promise...
View detailed explanation →Key Concepts
Promise.all 병렬 처리 Promise 생성 순서 유지
Time: O(n) Space: O(n)
solution.js
Ctrl + Enter
Run tests to see results here.