Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Testslkndgldnblkdnbklndlbnalvm
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 YaBrowser/24.4.0.0 Safari/537.36
Browser:
Yandex Browser 24
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Using the spread operator
5012186.5 Ops/sec
Using Object.assign
2909064.8 Ops/sec
Loop
1089858.6 Ops/sec
Tests:
Using the spread operator
const firstObject = { sampleData: 'Hello world', a: 1, b: 2, c: '3', d: '4', e: {}, f: [] } const secondObject = { moreData: 'foo bar', g: 5, h: '6', j: null, k: undefined } const finalObject = { ...firstObject, ...secondObject };
Using Object.assign
const firstObject = { sampleData: 'Hello world', a: 1, b: 2, c: '3', d: '4', e: {}, f: [] } const secondObject = { moreData: 'foo bar', g: 5, h: '6', j: null, k: undefined } const finalObject = Object.assign({}, firstObject, secondObject);
Loop
const firstObject = { sampleData: 'Hello world', a: 1, b: 2, c: '3', d: '4', e: {}, f: [] } const secondObject = { moreData: 'foo bar', g: 5, h: '6', j: null, k: undefined } const finalObject = {}; [firstObject, secondObject].forEach(object => Object.entries(object).forEach(([k, v]) => finalObject[k] = v))