3 ms·
"I found over 100 if statements that were always true/false or otherwise ineffective." I'm not sure whether that shows how good Typescript is or how bad Javasc
by tonyedgecombe 9y ago
"I found over 100 if statements that were always true/false or otherwise ineffective."
I'm not sure whether that shows how good Typescript is or how bad Javascript is.
- slackingoff2017 9y agoMostly the latter. With strict type checking enabled TsLint will warn you about impossible conditionals. You can go a step farther and force conditionals to return boolean true/false. This disables JavaScript's "truth/falsey" but prevents a whole class of errors caused by questionable design decisions... Like empty arrays being truthy.