1. Iterative Methods
every (FN): runs the given function for each item in the array, and returns True if the function returns true for each item.
Some (FN): runs the given function for each item in the array, and returns True if the function returns true for either item.
Filter (FN): runs the given function for each item in the array, and returns a type that matches a certain condition.
ForEach (FN): runs the given function for each item in the array, with no return value.
Map (FN): each item in the array runs the given function, returning an array that consists of the results of each function call.
2. Merge method
ECMAScript5 added 2 methods for merging arrays:reduce () and reduceright ().
reduce (): traverse through to the end one at a start of the first entry.
reduceright (): iterates to the first item of the array, starting with the last item in the array.
var values = [1, 2, 3, 4, 5]; var sum = values.reduce (function (prev, cur, index, array) { return prev + cur; }); alert (sum); As a result, it's just the opposite. var sum2=values.reduceright (function (prev,cur,index,array) { return prev+cur; }); alert (SUM2);
JavaScript iterative methods, merging methods