0

How,does the filter method update index of the new array, bcoz I am using filter to filter out selected items in an array

one at a time, each time returning a new array, but there are some items that the filter will just not remove. Sorry if I cannot write the code but it is because it is just too complex and unwieldy to write it all in a manner that anyone can understand, but I guess my main concern is if the filter updates the indexing or just leaves the remaining items with their initial index.The last item that is left in the array, will just not be filtered out, maybe it is my understanding of filter that is wrong.

5th Jul 2020, 6:46 PM
prime omondi
prime omondi - avatar
1 Respuesta
+ 1
If am not mistaken, filter will not effect original input array. It just copy values to new array which are passed on base function. So original array will not change or update.
5th Jul 2020, 7:10 PM
Jayakrishna 🇮🇳