Test name | Executions per second |
---|---|
Lodash cloneDeep | 2394029.0 Ops/sec |
Spread operator | 11400258.0 Ops/sec |
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
var MyObject = {
description: 'a',
myNumber: 123456789,
myBoolean: true,
};
var myCopy = null;
myCopy = _.cloneDeep(MyObject);
myCopy = {MyObject};