DEV Community

Hardik Mirg
Hardik Mirg

Posted on

Truthy - Falsy Values in JavaScript

Truthy and Falsy Values

Anything in JavaScript is either True or False.

There are different values to denote whether something is True or False.


Falsy Values

  • false
  • 0
  • null
  • Undefined
  • NaN
  • Empty String

Truthy Values

  • Anything that isn't Falsy.
  • Empty arrays and objects are Truthy.

Hope you learned something useful today! Peace Out ✌️

Top comments (0)