News for hackers. Stuff that matters.
Re:JavaScript for squares: The incredible rise of TypeScript by tonyedgecombe on Wednesday July 26, 2017 @03:24AM (#14854234)
"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.

Re:JavaScript for squares: The incredible rise of TypeScript by slackingoff2017 on Wednesday July 26, 2017 @04:48AM (#14854518)
Mostly 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.