Here we go again,let's clean up this mess.

So....we have 2 types equality operators

== called equality operator

=== called identity operator

**Most important to remember is that equality and identity operators are checks is both value are equals ,but identity operator checks more strictly (without using autoconversion so it means both value need to be of the same type (except NaN)**

Equality operator checks

- for strings, numbers and booleans

For example

1 == "1" will return true

1 == true will return true (Because boolean can represent true as 1 an false as 0)

- For arrays and object

Identity operator checks

- not only values as Equality, doesn't use automatic conversion ,so both values have the same value and
**the same type (if not are not equal)**,so

__false__(???))

So remember:

= means "assign to"

== means "equal to"

=== means "identical to"

1 ==/=== "1" will return true for equality operator and return false for identity operator because comparison has different type (it applied to 1 == true as well )

__not equal__to NaN for equality operator and identity operator but null ==/=== undefined will return true for equality operator and return false for identity operator

x = 5

means 5 is assign to variable x

for ==

x == 5

means 5 is equal to x (return will answer on question "Is 5 is equal to x?")

for ===

x === 5

means 5 is identical to x (return will answer on question "Is 5 is identical to x?")

If your comparison doesn't work in Java then can be 3 cases:

1) you mispell something in your code

2) you forgot about one of rule written in this post (about difference between == and === and result which will return

3) you forgot about difference between null undefined and NaN (null and undefined issues are explained in previous note

*Javascript is like other languages with some freaks or i usually said that javascript is a language created by Monty Python.