Test name | Executions per second |
---|---|
Object.assign | 3673571.5 Ops/sec |
spread operator | 3359725.2 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 };