Test name | Executions per second |
---|---|
Using the spread operator | 17402444.0 Ops/sec |
Using Object.assign | 5141542.5 Ops/sec |
const firstObject = {}
const secondObject = { moreData: 'foo bar' }
const finalObject = {
firstObject,
secondObject
};
const firstObject = {}
const secondObject = { moreData: 'foo bar' }
const finalObject = Object.assign(firstObject, secondObject);