Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 23, 2022 05:58 pm GMT

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


Original Link: https://dev.to/hardikmirg/truthy-falsy-values-in-javascript-1i20

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To