Underdash: A collection of snippets for array operations (á la lodash), that also work w/ (async) iterators!https://surma.github.io/underdash/
-
-
Replying to @DasSurma
For `unique`, instead of `arr.filter(lotsOfCode)` why not just `[...new Set(arr)]`?
1 reply 0 retweets 1 like -
Replying to @mathias
Because this: unique([{i:0,v:2},{i:1,v:3},{i:2,v:2}], e => e.v);
1 reply 0 retweets 0 likes -
-
Replying to @mathias
if you use it as unique([...], e => e), it’s the same :)
1 reply 0 retweets 1 like -
Replying to @DasSurma
Neat! Now I’m wondering which use case you had in mind when writing that…
1 reply 0 retweets 0 likes -
Replying to @mathias
E.g: List of comments. They are all different DOM elements but you can grab uniques with `e => e.textContent`
1 reply 0 retweets 0 likes
Replying to @DasSurma
`unique` is the new MapReduce!
8:46 AM - 8 Dec 2016
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.