[Solved] Is 0 considered true in ES6?


This is a list of all falsy values in javascript:

  • false
  • 0
  • ” or “”
  • null
  • undefined
  • NaN

Only the String ” is a falsy value, meaning that it is an empty string.
‘0’ is a string with content so it isn’t a falsy value, but 0 is one.

solved Is 0 considered true in ES6?