Test name | Executions per second |
---|---|
Using the spread operator | 2276216.8 Ops/sec |
Using Object.assign | 1626195.4 Ops/sec |
const firstObject = { sampleData: 'Hello world', b: 'foo', d: 'dummy' }
const clone = { firstObject };
const firstObject = { sampleData: 'Hello world', b: 'foo', d: 'dummy' }
const clone = Object.assign({}, firstObject);