News for hackers. Stuff that matters.
Re:JavaScript is Good, Actually by cprecioso on Wednesday May 16, 2018 @02:46AM (#17080445)
I agree that the writer shouldn't have used TypeScript to demonstrate JavaScript; but to be fair, the only thing you have to do to turn it into JS is remove the `as ConsignmentSetup` on the 4th line.
Re:JavaScript is Good, Actually by rootlocus on Wednesday May 16, 2018 @03:10AM (#17080551)
> the only thing you have to do to turn it into JS is remove the `as ConsignmentSetup`

Removing the cast means removing static typing. It might be a small change for this snippet, but at the project level, you'd need considerably more changes, and you'd lose type safety.