Explaining truthy, falsy, null, 0, and undefined in TypeScript

What is a Truthy or Falsy value?

Every possible variable value of any type will be implicitly converted to a boolean true or false value if needed. The need to do so is usually caused by an if-statement, having a non-boolean condition value. This implicit conversion from non-boolean values to boolean is based on some rules. These rules define for example that all numbers, except 0 and NaN, are converted to true.

The term truthy describes all values that will be converted to true.
The term falsy describes all values that will be converted to false.

Photo by David Rodrigo on Unsplash

This story happened to me in 2015 while wearing a Fitbit Charge HR fitness tracker. In the meantime, I switched to the newer Fitbit Charge HR 2. Although I haven’t tested this trick with the new version, it is probably still working. I would even say, this works with most if not all ‘floor counting’ fitness devices.

What is this all about?!

Those fitness tracker devices try to measure your daily activity and overall fitness level.

Since it’s not really possible to look into somebodies actual fitness level, those devices measure health related indicators. …

Photo by Jonatan Pie on Unsplash

When discussing different password strategies with people, I always hear an argument that goes like this.

As soon as I manage all my credentials with a single app or web service, an attacker only needs to attack a single place to grab all my secrets. This is introducing a single point of failure and incentivizing an attacker to target that precious password manager. Therefore, not using a password manager might be smarter.

This argument is only true if you are using different strong passwords for every single of your accounts. If you are not using different strong passwords for every…


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store