Test name | Executions per second |
---|---|
Array.prototype.concat | 5390275.5 Ops/sec |
spread operator | 21683872.0 Ops/sec |
Lodash merge | 353159.4 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var params = [ "hello", true, 7 ];
var other = [1,2].concat(params);
var params = [ "hello", true, 7 ]
var other = [ [1, 2], params ]
var params = [ "hello", true, 7 ];
var other = _.merge([], [1, 2], params);