+ 3
Where === and !== operators are used???
Please explain === and !== with proper example.
4 odpowiedzi
+ 19
== and != only checks of both sides have the save value.
=== and !== (strictly [not] equal to) compares both the value and the type. Both must be the same to check out true.
Ex:
"8" == 8 is true (Both sides are 8, and are considered equal by double ==).
"8" === 8 is false (string compared to int, so not strictly equal).
8.0 !== 8 is true (float compared to int).
+ 11
See SoloLearn's Javascript course, chapter Basic Concepts > Comparison Operators, lesson 2.
+ 5
@Tamra Thank you so much....😊
+ 3
@Tashi there is no valid explanation. Thanks to @Tamra i got my answer.