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

Clarification of the behavior #19

Open
zloirock opened this issue Nov 10, 2020 · 1 comment
Open

Clarification of the behavior #19

zloirock opened this issue Nov 10, 2020 · 1 comment

Comments

@zloirock
Copy link
Contributor

zloirock commented Nov 10, 2020

// How should be handled keys on `null` / `undefined`?
[{ a: 1 }, null, { a: null }].uniqueBy('a'); // => ???
[{}, undefined].uniqueBy('a');               // => ???
// How it should work when the resolver is not: `undefined` / callback / property key
[Object, Object, Object].uniqueBy({ toString() { return '' + Math.random() } }); // => ???
// Which arguments should be passed to the callback - only item, or, like in the rest array methods, 3 args?
[1, 2, 3].uniqueBy(function () { console.log(arguments.length) }); // => ???

The polyfill from the repo looks too raw for the answer to those questions.

@michaelficarra
Copy link
Member

I'm pretty sure the string parameter was wholly rejected by the committee at the last presentation, which would give you a simple answer to the first 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants