Test name | Executions per second |
---|---|
Object.keys | 3195904.0 Ops/sec |
_.isEmpty | 2740095.0 Ops/sec |
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js"></script>
window.obj = {};
Object.keys(window.obj).length === 0;
_.isEmpty(window.obj);