JS Variables

Last Updated: January 11, 2022

If you want to check whether the variable has a value

if( value ) {
}

will evaluate to true if value is not:

  • null
  • undefined
  • NaN
  • empty string (“”)
  • 0
  • false