Array Helper Methods in ES6
Callback function
Callback function 이란? - MDN
: A callback function is a function passed into another function as an argument, which is then invoked inside the outer function to complete some kind of rotine or action.
콜백 함수(A)는 다른 함수(B)의 인자로 넘겨지는 함수로,
다른 함수(B)의 내부에서 실행되는 함수(A)를 말한다.
1. map()
Returns a new array containing the results of calling
callbackFn
on every element in this array.
ex)
2. forEach()
Calls a callback function for each element in the array.
ex)
3. filter()
Returns the found element in the array, if some element in the array satisfies the testing callback function, or undefined if not found.
ex)
4. find()
Returns the found element in the array, if some element in the array satisfies the testing callback function, or undefined if not found.
ex)
5. every()
Returns true if every element in this array satisfies the testing callback function
ex)
Last updated
Was this helpful?