Array length comparison (v2)

Revision 2 of this benchmark created on


Description

Comparing array.length === 0 with < 0

Setup

const emptyArray = [];
const array = [""]

Test runner

Ready to run.

Testing in
TestOps/sec
< 1
const isEmpty = emptyArray.length < 1;
ready
=== 0
const isEmpty = emptyArray.length === 0;
ready
!== 0
const isEmpty = array.length !== 0;
ready
> 0
const isEmpty = array.length > 0;
ready

Revisions

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