-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixes #349: add _.partition function #1430
Conversation
fixes #349: add _.partition function
This one is really borderline because it's so close to the simplest use case for |
@@ -843,6 +844,17 @@ <h2 id="arrays">Array Functions</h2> | |||
=> [2, 3, 4] | |||
</pre> | |||
|
|||
<p id="partition"> | |||
<b class="header">partition</b><code>_.partition(array, predicate)</code> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay to use "predicate" now? The documentation doesn't currently use this term, though it should: "iterator" is both vague and slightly misleading.
I'd like to open a pull request to replace "iterator" with "predicate" where appropriate (in the code as well as the documentation). Would such a pull request be considered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I just used what was natural to me. I'd +1 such a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be a great change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very similar to |
It's still conflicting with a companion project. The way Underscore's _.groupBy([0, 1, 2, 3, 4, 5], isOdd);
// { 'false': [0, 2, 4], 'true': [1, 3, 5] } |
Why not change the function name in contrib, then? I suspect that Fogus would be OK with that. |
I'm not sure there is enough to differentiate it from |
Fixes #349.