Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Boolean constructor vs double negotiation trick in javascript
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Browser:
Firefox 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Boolean
1459.3M/s
Double negation trick
1426.4M/s
View exact numbers
Test name
Executions per second
✓
Boolean
1,459,279,104 Ops/sec
Double negation trick
1,426,402,944 Ops/sec
Script Preparation code:
var bFalse = false; var sEmpty = ''; var sFilled = 'Foo'; var nZero = 0; var nOne = 1;
Tests:
Boolean
Boolean(bFalse) Boolean(sEmpty) Boolean(sFilled) Boolean(nZero) Boolean(nOne)
Double negation trick
!!bFalse !!sEmpty !!sFilled !!nZero !!nOne