Which equals operator (== vs ===) is faster?
Is there a performance benefit to replacing == with ===?
Date tested:
6 years ago
User agent:
Mozilla/5.0 (Linux; Android 6.0.1; SM-G600FY Build/MMB29M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Mobile Safari/537.36
Test name
Executions per second
test equality
1589.2 Ops/sec
test strict equality
1555.0 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