Which equals operator (== vs ===) is faster?
Is there a performance benefit to replacing == with ===?
Date tested:
3 years ago
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 14_4_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1
Test name
Executions per second
test equality
26513.6 Ops/sec
test strict equality
26500.5 Ops/sec
Benchmark definition (click to collapse):
Tests:
test equality
var n = 0; while(true) { n++; if(n==100000) break; }
test strict equality
var n = 0; while(true) { n++; if(n===100000) break; }
Open this result on MeasureThat.net