Test name | Executions per second |
---|---|
lodash union | 2041470.9 Ops/sec |
object.assign | 567195.5 Ops/sec |
lodash uniq spread | 3161430.8 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var a = [ 'a', 'b', 'c' ];
var b = [ 'b', 'd', 'a', 'e', 'f' ];
var c = _.union(a, b);
var a = [ 'a', 'b', 'c' ];
var b = [ 'b', 'd', 'a', 'e', 'f' ];
var c = Object.assign([], a, b);
var a = [ 'a', 'b', 'c' ];
var b = [ 'b', 'd', 'a', 'e', 'f' ];
var c = _.uniq([a, b]);