Test name | Executions per second |
---|---|
Object.assign | 4167296.0 Ops/sec |
spread operator | 4297450.5 Ops/sec |
const acc = {a : [2,1], b: [1,3], c: [12, 23], d: [5,6]};
const newValue = { e: [3,4]};
return Object.assign(acc, newValue);
const acc = {a : [2,1], b: [1,3], c: [12, 23], d: [5,6]};
const newValue = { e: [3,4]};
return { acc, newValue };