⏳
Async Map
Async Map보통 비동기 +20pts
Problem
Write an async map function that processes array items with an async callback.
Examples
Input:
await asyncMap([1, 2], async x => x * 2)Output:
[2, 4]Explanation
이 문제는 **비동기 map**을 구현하여 병렬 비동기 처리를 학습합니다. ## 핵심 개념: 비동기 Map 배열의 각 요소에 비동기 함수를 적용하고 모든 결과를 모읍니다. ### 구현 ```javascript async function asyncMap(arr, callback) { return Promise.all(arr.map(callback)); } ``` ### 왜 이렇게 간단한가? 1. map으로 각 요소에 비동기 콜백 적용 → Promise 배열 2. Promise.all로 모든 Promise 완료 대기 3. 결...
View detailed explanation →Key Concepts
비동기 map Promise.all 병렬 처리 async/await
Time: O(n) Space: O(n)
solution.js
Ctrl + Enter
Run tests to see results here.