Test Array Length

Benchmark created on


Description

Testing and comparing speed between two ways of checking array length

Test runner

Ready to run.

Testing in
TestOps/sec
With > 0
const array  = ["a", "b", "c"]

if(array.length > 0) {
	console.log('Array has elements')
}
ready
Without > 0
const array  = ["a", "b", "c"]

if(array.length) {
	console.log('Array has elements')
}
ready

Revisions

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