--------- ES5.ES6 distal heart note

every()

  every () method for detecting whether all of the array elements meet the specified criteria (provided by the function).

  every () method uses all of the elements specified function of the detection array.

    If there is a detection element in the array is not satisfied, then the whole expression evaluates to false, and the remaining elements will not be detected. If all the elements to meet the conditions, it returns true.

  It does not change the original array

filter()

  filter () method creates a new array of new elements in the array by checking the specified array qualifying all the elements.

  It does not change the original array

forEach()

  forEach () method calls for each element in the array, and passed to the callback function element.

map()

  map () method returns a new array, the array element calls a function of the value of the original processing array elements.

  map () method in the original order of the processing elements in the array elements.

 

some()

  some () method with a detector element in the array satisfies the specified conditions.

  If a condition is satisfied, the expression returns true, the remaining elements will not perform detection. If you do not meet the conditions of the elements, false is returned.

 

Guess you like

Origin www.cnblogs.com/hudunyu/p/11427663.html