Open romainsimon opened 6 years ago
That’s definitely smaller :) Does it preserve order of the initial array?
On Thu, Jul 5, 2018 at 12:19 PM Romain SIMON notifications@github.com wrote:
const uniq = list => [...new Set(list)];
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ryanmcdermott/js-fp-algorithms/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AE4LKhQF6YUaaJ6fnXPkgNVNzix4TZ22ks5uDmbCgaJpZM4VEaKu .
-- ---------------------------- Ryan McDermott
github.com/ryanmcdermott https://github.com/ryanmcdermott
Yes It does !
Cool I didn't know that, in Python and in Set Theory in general, sets aren't ordered. Feel free to open a PR, thanks!
https://github.com/ryanmcdermott/js-fp-algorithms/blob/c90671460400df271512e62f7e29857a810f64f0/uniq/index.js#L16