isEmpty vs. vanilla
Date tested:
4 years ago
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
Test name
Executions per second
isEmpty
3668787.0 Ops/sec
vanilla
760274400.0 Ops/sec
Benchmark definition (click to collapse):
HTML Preparation code:
<script src='https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.5/lodash.min.js'></script>
Script Preparation code:
window.arr = []
Tests:
isEmpty
_.isEmpty([]);
vanilla
[].length
Open this result on MeasureThat.net