I have an array of items nested within another array of items. Im trying to remove a specific item within the nested array. I have the code below.
removeFromOldFeatureGroup() {
for( let i= this.featureGroups.length-1; i>=0; i--) {
if( this.featureGroups[i].featureGroupId == this.oldFeatureGroupId)
for( let z= this.featureGroups[i].features.length-1; z>=0; z--) {
if( this.featureGroups[i].features[z].featureId == this.featureId)
this.transferedFeature = this.featureGroups[i].features[z];
this.featureGroups[i].features[z].splice(z, 1);
return;
}
}
}
When i get to splice, an error is thrown saying splice is not a function. How can this be fixed? Also, this.transferedFeature is the correct one i need to remove.