Why does filter preserve keys?
matthewboman opened this issue · comments
What was the reason behind filter preserving the original array's keys? Is there a benefit to it? I'm most often filtering arrays where the key is an integer, so I'd expected filter to act more like it does in other languages creating a new array with values accessible by index.
I get that updating filter would lead to breaking changes, and there are probably times where the current implementation comes in handy, but it'd be useful to to have a function that filters an array and returns a new array that starts at zero.
If the maintainers feel like it would be useful and extend what phunctional is trying to do, I could work on an implementation.
Any improvement its welcome @crashspringfield!
As you mention, is better if we do not introduce any breaking change.
Thanks!