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