Coding Test
Programmers ์์ ํ์: ๋ชจ์๊ณ ์ฌ
Deviloper๐
2021. 8. 15. 10:24
โ ์๋ก ๋ฐฐ์ด ์
filter ํจ์๋ฅผ ์ฌ์ฉํ ๋ ์ธ ๊ฐ์ง์ argument๋ฅผ ๋ฐ์ ์ ์์ต๋๋ค.
1. ๊ธฐ๋ณธ์ ์ธ element
2. ํ์ฌ ์ฌ์ฉ๋๊ณ ์๋ element์ ์ธ๋ฑ์ค ๋ฒํธ
3. filter ํจ์์ ์ฌ์ฉ๋๋ ๋ฐฐ์ด
element
The current element being processed in the array.
index (Optional)
The index of the current element being processed in the array.
array (Optional)
The array filter
was called upon.
์ฐธ๊ณ
Array.prototype.filter() - JavaScript | MDN
The filter() method creates a new array with all elements that pass the test implemented by the provided function.
developer.mozilla.org