I have Javascript Filter Item Class and array which is like below
function FilterItem(filterId, filterType) {
this.filterId = filterId;
this.filterType = filterType;
}
var filterItemArray = [];
I am adding Filter Items to this array like below
function AddFilterItem(filterId, filterType) {
filterItemArray.push(new FilterItem(filterId, filterType));
}
I also need to remove item from this array by specific filterId
function RemoveFilterItem(filterId, filterType) {
var item = new filterItem(filterId, filterType);
var itemIndex = jQuery.inArray(item, filterItemArray);
}
But this does not work and I dont think it is the efficient way? My Question is what is the best way to remove this item in RemoveFilterItem Method

AddFilterItemandRemoveFilterItem, useFilterItem.prototype.addandFilterItem.prototype.remove