how to check truthy javascript code example
Example 1: js convert truthy
!!"" // false
!!0 // false
!!null // false
!!undefined // false
!!NaN // false
!!"hello" // true
!!1 // true
!!{} // true
!![] // true
Example 2: javascript truthy
// Truthy values:
// All values are truthy, BUT (excluding) the following:
0
''
undefined
null
NaN