!== operator in js. How to rightly use? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

!== operator in js. How to rightly use?

!== operator in js. How to rightly use?

2nd Aug 2018, 1:45 AM
Глеб Караман
1 Answer
+ 1
You can use it when you need both values to be equal and of the same type. This is because the inequality operator ( != ) Does not verify the type of both values to be compared. Example: The expression 3! = '3' gives a false result. Since both values are equal, although they are of different types. The expression 3! == '3' gives true as result. Since both values are equal, but are of different types https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
2nd Aug 2018, 2:39 AM
Mickel
Mickel - avatar