์๊ณ ๋ฆฌ์ฆ
2024. 9. 23.
[LeetCode][JS] Execute Asynchronous Functions in Parallel
https://leetcode.com/problems/execute-asynchronous-functions-in-parallel/description/?envType=study-plan-v2&envId=30-days-of-javascript๐ฏ ๋ฌธ์ ์ฃผ์ด์ง ๋ฌธ์ ๋ ๋น๋๊ธฐ ํจ์๋ค์ ๋ฐฐ์ด์ด ์์ ๋, ์๋ก์ด `Promise` ๊ฐ์ฒด๋ฅผ ๋ฐํํ๋ ํจ์๋ฅผ ์์ฑํ๋ ๊ฒ์ด๋ค. ๋ฐฐ์ด์ ์๋ ๊ฐ ํจ์๋ ์ธ์๋ฅผ ๋ฐ์ง ์๊ณ , `Promise`๋ฅผ ๋ฐํํด์ผ ํ๋ค. ๋ชจ๋ `Promise`๋ ๋ณ๋ ฌ๋ก ์คํ๋์ด์ผ ํ๋ค.ํด๊ฒฐ ์กฐ๊ฑด:1. `Promise`๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์ฒ๋ฆฌ๋ ๋:๋ฐฐ์ด ๋ด ๋ชจ๋ ๋น๋๊ธฐ ํจ์๋ค์ด ๋ณ๋ ฌ๋ก ์คํ๋ ํ, ๊ทธ ํจ์๋ค์ด ๋ฐํํ ๋ชจ๋ `Promise`๊ฐ ์ฑ๊ณต์ ์ผ๋ก ์๋ฃ๋๋ฉด, ์ต์ข
`promise`๊ฐ ๋ฐฐ์ด์ ๋ชจ๋ ์ฑ๊ณต์ ์ธ ..