Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
negation vs equality
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Browser:
Chrome 125
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
filter with false equality
18419728.0 Ops/sec
filter with negation
14612296.0 Ops/sec
Script Preparation code:
var ops = [true, 1, false, 3, 4, 5, true, "foobar", {}, 3, 4, 5, 6, [], false, 2, true, 2, false, 212, true, 34, 1, 1.909090090909009090909090909, undefined];
Tests:
filter with false equality
ops.filter(op => op === false)
filter with negation
ops.filter(op => !op)