Ad
  • Default User Avatar

    false, 0, "", null and undefined all have the property that when used in a if statement that they will equate to false. So it isn't necessary at all.

    As for production code, it is used without the === true. Which is generally done for all if statements. We also don't write code like

    if ((index === 4) === true) {
      // some logic
    }
    
  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution