When should you use === vs ==, !== vs !=, etc.. in javascript? [duplicate]

=== is the Identity operator, and is used to test that value and type are equal.

so..

"3" == 3 // true
"3" === 3 // false
1 == true // true
1 === true // false
"1" == true // true
"1" === true // false

so when you care that value and type are equal, or not equal use Identity operators === or !==

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)