3 ms·
I find this argument weird. JS doesn't have Public Class fields yet [1] (stage 3), hence any TS or JS code making use of such concept will differ. Similarly, a
by timdaub 6y ago
I find this argument weird. JS doesn't have Public Class fields yet [1] (stage 3), hence any TS or JS code making use of such concept will differ.
Similarly, as reliance of types in JS is not guaranteed, as it may in TS, will produce code with different assumptions too.
So while you may "easily" go from (1) JS => TS, it may be much harder going from (2) TS => JS, as in (1) you're preserving all information and in (2) you're losing information.
My point being, TS !== JS.
- [1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...