umerata
8/11/2017 - 10:21 AM

Find and remove an element from array | label-js

Find and remove an element from array

var arr = [1, 2, 3, 4, 5];
var removeItem = 2;   
 
arr = $.grep(arr, function(value) {
  return value != removeItem;
});