Test name | Executions per second |
---|---|
Using the spread operator | 14595909.0 Ops/sec |
Using Object.assign | 4140411.8 Ops/sec |
const firstObject = { sampleData: 'Hello world' }
const finalObject = {
firstObject,
};
const firstObject = { sampleData: 'Hello world' }
const finalObject = Object.assign({}, firstObject);