Test name | Executions per second |
---|---|
Using the spread operator | 1909219.2 Ops/sec |
Using Object.assign | 6209119.0 Ops/sec |
const firstObject = { test: 'Hello world', test1: "blah", test2: "ze" }
const secondObject = { test1: 'La woopp', test2: 'te' }
const finalObject = {
firstObject,
secondObject
};
const firstObject = { test: 'Hello world', test1: "blah", test2: "ze" }
const secondObject = { test1: 'La woopp', test2: 'te' }
const finalObject = Object.assign(firstObject, secondObject);