proposal-array-unique
proposal-array-unique copied to clipboard
Clarification of the behavior
// 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.
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.