Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36
Chrome 111
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
Lodash cloneDeep 2248617.2 Ops/sec
Spread operator 11248066.0 Ops/sec
HTML Preparation code:
AخA
 
1
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
x
 
var MyObject = {
  description: 'a',
  myNumber: 123456789,
  myBoolean: true,
};
var myCopy = null;
Tests:
  • Lodash cloneDeep

     
    myCopy = _.cloneDeep(MyObject);
  • Spread operator

     
    myCopy = {...MyObject};