JavaScript Comparison Operations

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Remarks

When using boolean coercion, the following values are considered "falsy":

  • false
  • 0
  • "" (empty string)
  • null
  • undefined
  • NaN (not a number, e.g. 0/0)
  • document.all¹ (browser context)

Everything else is considered "truthy".

¹ willful violation of the ECMAScript specification



Got any JavaScript Question?