Tuesday 24 October 2017

Difference between == and === in Javascript.

In this article we will Discuss about the Difference between == and === in Javascript.

== in Javascript means it will check for the Equality condition with automatic type conversion of data.

=== in Javascript means it will check for the Equality condition without automatic type conversion of data.

Example:-
-----------------

78 == "78" 
Output:- true because it will automatically Convert value

78 === "78"
Output:- false because they are of different type


So it is better to Use === and which gives more accurate result as compared to ==. 

0 comments:

Post a Comment