Test name | Executions per second |
---|---|
lodash union | 1771737.5 Ops/sec |
Set from flatten | 1256062.6 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var list = [[ 'a', 'b', 'c' ], [ 'b', 'd', 'a', 'e', 'f' ]];
var c = _.union(list);
var c = new Set(_.flatten(list))