Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Windows
Desktop
one year ago
Length property cast with destructuring
156K/s
Length property cast without destructuring
155K/s
Comparison (row.length > 0) without destructuring
154K/s
Double negation (!!row.length) with destructuring
154K/s
Array.length property
154K/s
Comparison (row.length > 0) with destructuring
153K/s
Array.some() method
152K/s
Double negation (!!row.length) without destructuring
152K/s
for...of loop
152K/s
First element check
151K/s
Array.isArray() with length
150K/s
typeof with length
145K/s
Boolean constructor
128K/s
Double negation (!!row)
118K/s
Object.keys()
694/s
View exact numbers
Test name Executions per second
Length property cast with destructuring 155,992 Ops/sec
Length property cast without destructuring 155,273 Ops/sec
Comparison (row.length > 0) without destructuring 154,273 Ops/sec
Double negation (!!row.length) with destructuring 154,256 Ops/sec
Array.length property 153,668 Ops/sec
Comparison (row.length > 0) with destructuring 152,593 Ops/sec
Array.some() method 152,293 Ops/sec
Double negation (!!row.length) without destructuring 152,011 Ops/sec
for...of loop 151,516 Ops/sec
First element check 150,875 Ops/sec
Array.isArray() with length 150,011 Ops/sec
typeof with length 145,367 Ops/sec
Boolean constructor 128,206 Ops/sec
Double negation (!!row) 117,825 Ops/sec
Object.keys() 694 Ops/sec
Script Preparation code:
Tests: