Lodash _.isEmpty() vs native JS length === 0 (v2)

Revision 2 of this benchmark created on


Description

Test the performance of detecting an empty array using Lodash's _.isEmpty() method vs native JavaScript way.

Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.1.0/lodash.js"></script>

Setup

var emptyArray = [];
    var bigArray = new Array(1000000);

Teardown


    bigArray = [];
  

Test runner

Ready to run.

Testing in
TestOps/sec
Lodash _.isEmpty(bigArray)
_.isEmpty(emptyArray);
_.isEmpty(bigArray);
ready
Native JS length === 0
emptyArray.length === 0;
bigArray.length === 0;
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.