JQuery - remove array element by value :
Method -1 :
var arr = [Subhu,Mohan,Kannan,Sathish,Hari];
var removeItem = "Kannan";
newArray = jQuery.grep(arr, function(value) {
return value != removeItem;
});
Result:
[Subhu,Mohan,Sathish,Hari]
Method -2 :
var arr = [Subhu,Mohan,Kannan,Sathish,Hari];
var removeItem = "Kannan";
newArray.splice( $.inArray(removeItem, arr), 1 );
Result:
[Subhu,Mohan,Sathish,Hari]
Method -3 :
var arr = [Subhu,Mohan,Kannan,Sathish,Hari];
var removeItem = "Kannan";
newArray.splice(arr.indexOf(removeItem),1);
Result:
[Subhu,Mohan,Sathish,Hari]
Method -4 :
var arr = [Subhu,Mohan,Kannan,Sathish,Hari];
var removeItem = "Kannan";
arr.remove(removeItem);
Result:
[Subhu,Mohan,Sathish,Hari]