I've encountered an issue while trying to remove a specific item from a nested array of items within another array. Below is the code snippet:
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.splice(z, 1);
return;
}
}
}
But when the code reaches the splice method, it throws an error saying that "splice is not a function". How can I correct this error? Additionally, the variable 'this.transferedFeature' contains the item I want to remove.