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

Answer:

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

This operator checks for value.

Example:

100==”100″

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.

Example:

100===”100″

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