proposal-array-unique icon indicating copy to clipboard operation
proposal-array-unique copied to clipboard

Clarification of the behavior

Open zloirock opened this issue 4 years ago • 1 comments

// 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.

zloirock avatar Nov 10 '20 15:11 zloirock

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.

michaelficarra avatar Nov 13 '20 17:11 michaelficarra