Tests:
  • Using the spread operator

    AخA
     
    const firstObject = { sampleData: 'Hello world' }
    firstObject.moreData = 'foo bar'
  • Using Object.assign

     
    const firstObject = { sampleData: 'Hello world' }
    const secondObject = { moreData: 'foo bar' }
    const finalObject = Object.assign(firstObject, secondObject);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Using the spread operator
    Using Object.assign

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0
Firefox 100 on Linux
View result in a separate tab
Test name Executions per second
Using the spread operator 61361304.0 Ops/sec
Using Object.assign 8118188.5 Ops/sec