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
Double negation (!!row.length) with destructuring
152K/s
Double negation (!!row.length) without destructuring
151K/s
Array.some() method
150K/s
Comparison (row.length > 0) with destructuring
150K/s
Comparison (row.length > 0) without destructuring
149K/s
First element check
149K/s
Array.length property
148K/s
for...of loop
148K/s
Array.isArray() with length
147K/s
typeof with length
142K/s
Boolean constructor
122K/s
Double negation (!!row)
114K/s
Object.keys()
668/s
View exact numbers
Test name Executions per second
Double negation (!!row.length) with destructuring 152,024 Ops/sec
Double negation (!!row.length) without destructuring 150,900 Ops/sec
Array.some() method 149,991 Ops/sec
Comparison (row.length > 0) with destructuring 149,770 Ops/sec
Comparison (row.length > 0) without destructuring 149,477 Ops/sec
First element check 149,052 Ops/sec
Array.length property 148,236 Ops/sec
for...of loop 147,991 Ops/sec
Array.isArray() with length 147,376 Ops/sec
typeof with length 142,090 Ops/sec
Boolean constructor 122,064 Ops/sec
Double negation (!!row) 113,755 Ops/sec
Object.keys() 668 Ops/sec
Script Preparation code:
Tests: