News for hackers. Stuff that matters.
Re:Flow vs. Typescript by Matthias247 on Monday June 06, 2016 @03:41AM (#11845226)
Regarding the first class definition with TS (sayer):

You can shorten the it by declaring the public variable within the constructor: constructor(public this.what: string) {}. Thereby you can eliminate the property declaration as well as the assignment inside the constructor.

And regarding the non-nullable example for Typescript: I think there is an non-implicit-returns option or something similar for the compiler which would have warned you that the function is incomplete. Of course it wouldn't help if you manually return null/undefined (which is valid).

There are no comments on this comment yet.