You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I tried to use partition and expected to be able to access the element index like normal array methods, but it isn't passed to the callback.
Describe the solution you'd like
Pass the element index to the partition callback. If the maintainers think this is a good idea, there are other methods in collections that could be passed the index as well. Maybe we should even consider passing in the original array as the third argument to match the signature of most built-in array method callbacks.EDIT: I noticed that most methods accept iterables so passing in the original array does not make sense.
Describe alternatives you've considered
Call .filter twice to partition the array instead.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I tried to use
partition
and expected to be able to access the element index like normal array methods, but it isn't passed to the callback.Describe the solution you'd like
Pass the element index to the
partition
callback. If the maintainers think this is a good idea, there are other methods incollections
that could be passed the index as well.Maybe we should even consider passing in the original array as the third argument to match the signature of most built-in array method callbacks.EDIT: I noticed that most methods accept iterables so passing in the original array does not make sense.Describe alternatives you've considered
Call
.filter
twice to partition the array instead.The text was updated successfully, but these errors were encountered: