Test name | Executions per second |
---|---|
_.isEqual | 2020323.4 Ops/sec |
JSON.stringify | 1103266.6 Ops/sec |
<script src="https://cdn.jsdelivr.net/npm/lodash@4.17.4/lodash.min.js"></script>
window.foo = [
'cat',
'dog',
'bird',
{
banana: {
color: 'yellow'
},
},
];
window.bar = [{
banana: {
color: 'yellow'
},
},
'cat',
'dog',
'bird',
];
_.isEqual(window.foo, window.bar)
JSON.stringify(window.foo) === JSON.stringify(window.bar);