JavaScript Truthy and Falsy
May 8, 2021
The following values are always falsy:
1 ) false
2) 0
3) ‘’ or “”(empty string)
4) null
5) NAN
Everything else is truthy. Some examples are given below
‘0’ (a string containing a single zero)
‘false’ (this is also truthy as it is string)
{} (an empty object)
function() {} (an empty function)
[] (an empty array)
true (Boolean true)
Number
String
Symble