0👍
✅
This is a shallow copy issue, the this.locationData
is still referencing to the original this.locationData
You nee to clone the array into a new array (deep copy)
it can be done using spread operator
this.locationData = [...filteredLocations];
Or using Array.from
this.locationData = Array.from(filteredLocations);
Source:stackexchange.com