22 Flashcards
(5 cards)
1
Q
x === y
A
true if both sides are exactly the same
2
Q
”===” does type coercion?
A
No
3
Q
”==” does type coercion?
A
Yes
4
Q
Best Practice “===” vs. “==”
A
- use “===” even if you need type coercion (convert the value manually before the comparison)
- avoid “==” as much as you can (because it can introduce many hard to find bugs)
5
Q
Best Practice “!==” vs. “!=”
A
- use “!==” (strict version)
- avoid “!=” (loose version)