Which equals operator (== vs ===) should be used in JavaScript comparisons?

asked17 years ago
last updated8 years ago
viewed2.1m times
Up Vote5.7kDown Vote

I'm using JSLint to go through JavaScript, and it's returning many suggestions to replace == (two equals signs) with === (three equals signs) when doing things like comparing idSele_UNVEHtype.value.length == 0 inside of an if statement.

Is there a performance benefit to replacing == with ===?

Any performance improvement would be welcomed as many comparison operators exist.

If no type conversion takes place, would there be a performance gain over ==?