is Array

Benchmark created on


Description

Make sure if you want to use the second test you don't have an object with a .length property. (eg: string or object with length prop)

Setup

const arr = []

const noArr = {}

Test runner

Ready to run.

Testing in
TestOps/sec
isArray
if (Array.isArray(arr)) {
	
}

if (Array.isArray(noArr)) {
	
}
ready
length not undefined
if (arr.length >= 0) {
	
}

if (noArr.length >= 0) {
	
}
ready

Revisions

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