I have an array of objects in the form of
[
{prop1: value1,
banks:[{_id:value,property2:value2}]
}]
So what I want to do is delete an element in "banks" property by searching for the "_id" value and then remove the found element from the banks array
"_id" property has unique values so there are no multiple occurrences of any value
I am doing this like
$scope.account.banks.splice($scope.account.banks.indexOf(item),1);
is there any better way for doing this?
indexOfonitemactually work?prop1andbanksas members?