Test name | Executions per second |
---|---|
Using the spread operator | 292353.2 Ops/sec |
Using Object.assign | 503474.5 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);