Skip to content
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

Update docs for `_.intersectionWith` comparator to avoid confusion regarding comparator argments #4720

Open
vjpr opened this issue Apr 9, 2020 · 0 comments

Comments

@vjpr
Copy link

@vjpr vjpr commented Apr 9, 2020

I just ran into the same issue as here: #2798

It current says "The comparator is invoked with two arguments: (arrVal, othVal).". I assumed that arrVal was the first array, and othVal would always be one of the other arrays.

When you read "The order and references of result values are determined by the first array", it also makes you think that arrVal is always the first array.

Also the signature is written as:

_.intersectionWith(objects, others, _.isEqual);

It should be made clear that the params of the comparator can be either objects or any of the others arrays.

@vjpr vjpr changed the title Update docs for `_.intersectionWith` comparator fo avoid confusion Update docs for `_.intersectionWith` comparator to avoid confusion regarding comparator argments Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.