HTML Preparation code:
AخA
 
1
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
Script Preparation code:
 
var arr = [
  {
    "id": 52
  },
  {
    "id": 76
  },
  {
    "id": 13
  },
  {
    "id": 96
  },
  {
    "id": 27
  },
  {
    "id": 8
  },
  {
    "id": 23
  },
  {
    "id": 63
  },
  {
    "id": 25
  }
]
Tests:
  • Native

     
    arr.map(elem => ({
      ...elem,
      className: 'pizza'
    }))
  • Lodash.js cloneDeep

     
    _.cloneDeep(arr).map(elem => {
      elem.className = 'pizza';
      return elem;
    })
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Native
    Lodash.js cloneDeep

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
Safari 13 on Mac OS X 10.15.6
View result in a separate tab
Test name Executions per second
Native 477461.3 Ops/sec
Lodash.js cloneDeep 192071.4 Ops/sec