22 Flashcards

(5 cards)

1
Q

x === y

A

true if both sides are exactly the same

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

”===” does type coercion?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

”==” does type coercion?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Best Practice “!==” vs. “!=”

A
  • use “!==” (strict version)
  • avoid “!=” (loose version)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly