sainture
5/15/2017 - 5:42 AM

Iteration Methods (arrays & objects)

Iteration Methods (arrays & objects)

// $.grep

// Finds the elements of an array which satisfy a filter function. The original array is not affected.

var arr = [ 1, 9, 3, 8, 6, 1, 5, 9, 4, 7, 3, 8, 6, 9, 1 ];

var newArr = $.grep(arr, function( a ) {
  return a !== 9;
});