4 ms·
I'm not one to prematurely optimize things, but I'd be cautious about blindly copy/pasting some of these solutions unless you want your coworkers to make fun of
by tlrobinson 7y ago
I'm not one to prematurely optimize things, but I'd be cautious about blindly copy/pasting some of these solutions unless you want your coworkers to make fun of your O(n^3) set intersection algorithm:
array.reduce(function(a, b) {
return a.filter(function(value) {
return b.includes(value);
});
}))
https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_intersection https://github.com/you-dont-need/You-Dont-Need-Lodash-Unders...
- Griffinsauce 7y agoSo you stand the risk of actually learning something and improving your skillset. I'd say that's a plus.