filter() 함수
filter는 해석 그대로 걸러주는 역할을 하는 함수이다. 주로 특정 조건을 만족하는 새로운 배열을 필요로 할 때 사용하는 편이다. SQL로 치면 where절에서 하는 행위를 하는 함수이다. 예제 const numbers = [1, 2, 3, 4, 5]; const result = numbers.filter(number => number > 3); console.log(numbers); // [1, 2, 3, 4, 5]; console.log(result); // [4, 5] 중복 제거하기 const numbers = [1, 1, 2, 2, 3, 4, 5]; const newNumbers = numbers.filter((number, index, target) => { return target.index..