
Array.prototype.filter() 이 filter()메서드는 제공된 함수로 구현된 테스트를 통과하는 모든 요소가 포함된 새 배열 을 만듭니다. const words = ['spray', 'limit', 'elite', 'exuberant', 'destruction', 'present']; const result = words.filter(word => word.length > 6); console.log(result); // expected output: Array ["exuberant", "destruction", "present"] 사용법 // Arrow function filter((element) => { ... } ) filter((element, index) => { ... } ) ..
NestJS
2021. 10. 4. 21:33