4 ms·
I have no idea which craziness they were referring to, but one thing that TS doesn't provide (for probably obvious reasons) that could be considered craziness,
by pacaro 5y ago
I have no idea which craziness they were referring to, but one thing that TS doesn't provide (for probably obvious reasons) that could be considered craziness, is an integer type. You're still stuck with the JS number.
- mixmastamyk 5y agoStuff like "===" and "use strict; for non-baffling behavior." Lots more of these kind of things I don't want to think about. I want fewer broken things to avoid. A subset, not a superset.
- pacaro 5y agoFor sure. Typescript definitely gets you away from the worst of these, the typing mitigates most of the craziness about the two exact issues that you mention. But nonetheless, when the rubber hits the road, it's still JavaScript that is running, so weirdness is definitely still a thing
- Humphrey 5y agoTS does take into account things like === and you can get warnings for using them wrongly. But I'm not certain... I just don't find myself thinking about === and use strict.
- Humphrey 5y ago> one thing that TS doesn't provide ... is an integer type. This! I'd love an integer type, and I think this would be within the scope of TS: Use a JS number when running, but type check it to integer. There is JS bigint though.