News for hackers. Stuff that matters.
Re:Flow vs. Typescript by k__ on Monday June 06, 2016 @06:10AM (#11845637)
null and undefined are part of every type in TS, but you can tell it to exclude it from every type by default (with TS2.0). Then you are forced to check for it on every part of your code where it possibly could become null or undefined (like when data from external libs comes in etc.), so inside the TS code everything should be save to use. (no more: a && a.b && a.b.c = 123)

I have the feeling that even if you would just use "any" (with excluded null and undefined) everywhere 90% of JS problems would go away.

There are no comments on this comment yet.