Test name | Executions per second |
---|---|
Basic object spread | 16259080.0 Ops/sec |
Basic assign operator | 5446201.0 Ops/sec |
Assign with empty object | 4650612.0 Ops/sec |
const obj = { foo: 1, bar: 2 };
const finalObject = ({ baz: 3, obj })
const obj = { foo: 1, bar: 2 };
const finalObject = Object.assign({baz: 3}, obj);
const obj = { foo: 1, bar: 2 };
Object.assign({}, obj, { baz: 3 });