What are the falsy values in JavaScript?

const falsyValues = ['', 0, null, undefined, NaN, false];

Falsy values are values that when converted to boolean becomes false.

How to check if a value is falsy?

Use the Boolean function or the Double NOT operator !!


October 21, 2022
952