JavaScriptJavaScript · Lesson 03
Operators & Comparison
Arithmetic, == vs ===, logical operators and truthiness.
Video tutorialTrack course · freeCodeCamp
Speed
Transcript & captions
6/6
Always use === and !== . The loose == converts types before comparing, which produces surprises like '5' == 5 being true.
Falsy values: false, 0, -0, '' , null, undefined, NaN. Everything else is truthy.
Try it yourself
Knowledge check
0/1 answeredWhich operator only falls back for null/undefined?