In JavaScript, we can convert
values of any data type to boolean.
We can use Boolean()
to convert
any value to a boolean value.
Values such as the number 0
,
false
, null
, undefined
, NaN
,
and
the empty string ""
,
will get converted to false
.
These values are called
falsy values.
All the values
we have mentioned above,
except the falsy values,
are truthy values.