Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.112 Safari/537.36
Chrome 86
Linux
Desktop
one year ago
Test name Executions per second
merge 226649.4 Ops/sec
set a value 74262248.0 Ops/sec
Tests:
  • merge

    x
     
    let obj1 = { first: 'first', second: 'second', third: 'third' };
    const obj2 = { fourth: 'fourth' };
    obj1 = {
      ...obj1,
      ...obj2,
    };
  • set a value

     
    let obj1 = { first: 'first', second: 'second', third: 'third' };
    obj1.fourth = 'fourth';