17
Comments
  • 1
    When parsing bools extern or input, I oftentimes cast to a string and check it's equal to "true". As a guarding measure.

    Internally when I don't need to be strict, I oftentimes just defer to evaluate it's truthy, as it's a bit more flexible.

    - I might make it strict on a later refactor step though.
  • 2
    At work we like to keep it as simple as possible, but also as readable.
    So if(condition === true) is what I use
  • 1
    If(condition) if the program is small and isn't used much.

    This way I know for definite it won't return Null or anything like that
  • 1
    if (true == condition)
  • 1
    2nd 😊
  • 1
    if (condition == true && condition != false)
Add Comment