Difference between equality operators == and === in Javascript

Comparison operators in Javascript. This is equality operators.

== and === are comparison operators

Equality Operators Difference between == and === in Javascript

== is type-converting equality comparison operator and
=== is strict quality comparison operator

Know more about equality operators by examples

let see the meaning of this by an example
it is true if
I check
0 == false => true

[code javascript]

<script type="text/javascript">

if(0==false){

 console.log("Its True");

}

else{

console.log("Sorry Its False");

}

</script>

[/code]

Output:Its True

Reason:
In javascript, 0 and false are same.
So its result is true.

Lets check with === operator

Now you can see result
0 === false => false

[code javascript]

<script type="text/javascript">

if(0===false){

 console.log("Its True");

}

else{

console.log("Sorry Its False");

}

</script>

[/code]

Output: Sorry Its False

In this case, We are comparing using strict equality operator.
It compares everything of two variables. It checks the type of variable, length of
variables, sequence of characters.
But in this case
0 is an integer and false is boolean.
So result comes as false

what do you think for
"5" == 5 => True
Here "5" is a string but it can be treated as an integer.
Result is true

"5" === 5 => False
Its follow strict rule.
So, a string cannot be equal to an integer.
In this comparison, Data type must be equal.
Result is false

Lets try another example:

true == "true" => False
true === "true" => False
What do you think?
Could you explain it? If yes, You can comment on this video.

I think, Now you understand the difference between equality operators == and ===.

Click here to check other Javascript operators.
If you have any question, Feel free to ask.
Thanks