3 ms·
What sort of errors wouldn’t have been errors in JS?
by Sharlin 6y ago
What sort of errors wouldn’t have been errors in JS?
- AnIdiotOnTheNet 6y agoThe ones that are hellishly difficult to diagnose bugs waiting to be discovered I'll bet.
- mcv 6y agoNo, just the trivial boilerplate stuff. Forgetting to declare `this` as a parameter, for example.
- spanhandler 6y agoThere are some "cute" uses of truthiness checks that work in JS (and, in some cases, weren't flagged as errors by earlier versions of TS) that are probably a bad idea and are trivial to render more-explicit, so better, but do technically run OK. Example: "if(obj.some_method) {obj.some_method();}". Not an uncommon form in JS in the wild, but TS (correctly) flags it as a problem. Otherwise I dunno what this could be. Especially what TS could be disallowing that'd be all of: valid in JS, a good idea in JS, and especially time-consuming to fix.
- deleted 6y ago[deleted]