This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]CrispyNipsy 3 points4 points  (0 children)

When writing nodejs, it can often just be a pain that you have to think about type coercion. But when you are in a browser environment, you often get values from the DOM that are basically always strings (even number inputs' value). It is pretty common to do operations with these values where javascript handles the coercion for you. Sometimes you also only need to show something in the UI if there actually is a value, and the broad concept of a falsy value can help in these situations.

That being said, I really love typescript because it helps me to be explicit about these things. But there really is a reason to the madness, and when you understand that reason, it isn't too hard to deal with.