Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array.isArray vs truthy
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:144.0) Gecko/20100101 Firefox/144.0
Browser:
Firefox 144
Operating system:
Windows
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
Array.isArray
75351480.0 Ops/sec
truthy
128672928.0 Ops/sec
Script Preparation code:
var a = []; var b = ['1', '2']; var c = undefined; var d = [1,2,3];
Tests:
Array.isArray
Array.isArray(a)? 'true' : 'false';Array.isArray(b)? 'true' : 'false';Array.isArray(c)? 'true' : 'false';Array.isArray(d)? 'true' : 'false';
truthy
a ? 'true' : 'false';b ? 'true' : 'false';c ? 'true' : 'false';d ? 'true' : 'false';