Ad
  • Custom User Avatar

    tbh, best practise would be to use a language with a proper strict type system if you want to be sure to avoid these issues. All else is a bandaid/workaround.

  • Custom User Avatar

    I agree, cuts out the truthy weirdness. In the 'long run'/'Big Picture' you shouldn't rely on truthy values.

  • Custom User Avatar

    What is maintainability and readability here? 0 being falsy is by language design, so anyone who's writing and reading JS should be expecting that.

    Well, I mean, maybe there's a liiiiiiittle bit of sacrifice? But it's so trivial it's highly likely to not matter in practice, and is definitely not as exaggerated as that.

  • Default User Avatar

    Could you look into the updated error messages and close the issue? Thanks!