DEV Community

Hardik Mirg
Hardik Mirg

Posted on

3 2

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay