What is the difference between == and === in javascript?


== operator tests for abstract equality. The operator does the necessary type conversion before doing the equality comparison.

This operator checks for value.



The above condition returns true. The right-hand side string is converted to a number and then compared to 100.

  • === operator tests for strict equality.
  • No type of conversion happens with this operator.
  • This operator checks for both value and type.



The above condition returns false. Here value is 100 and but their type is not the same. so it returns false.

Difference between == and === in javascript?

Automation Testing Books Business Analyst Companies Companies In Mumbai Developer Jobs DevOps Engineer Electronics Companies Freshers Jobs Software Hotels In India Insurance Interview News Performance Testing Sales Jobs Scrum Master Service Software Testing