Every:
Each item in an array runs the given function, and returns TRUE if the function returns true for each item.
var number = [1,2,3,4,5,6]; var result = Number.every (function(item,index,array) { return (item > 0 )}) Console.log (result) //true
For every (), the incoming function must return true for each entry, which returns TRUE, otherwise he returns false;
Some
Returns True if the function returns true for any of the given functions in an array.
var number = [1,2,3,4,5,6]; var result = Number.some (function(item,index,array) { return (item > 5 )}) Console.log (result) //true
Filter
An array of items that return true for each item in the given function that returns the function.
var number = [1,2,3,4,5,6]; var result = Number.filter (function(item,index,array) { return (item > 5 )}) Console.log (result) //[6]]
Map
Runs the given function for each item in the array, returning the arrays that comprise the result of each function call
var number = [1,2,3,4,5,6]; var result = Number.map (function(item,index,array) { return (item + 5)}) Console.log (Result) //[6,7,8,9,10,11]
Foreach:
Each item in the array is given a function. This method has no return value
var number = [1,2,3,4,5,6];number.foreach (function(item,index,array) { * 5)})
Iterative methods for arrays (every, filter, ForEach, map, some)