The Strong & Silent TypeScript
Last week, Microsoft introduced a proposal for types syntax in JavaScript.
This can be distilled down to two ways of thinking:
- TypeScript with no build step
- JavaScript with types
Types in JavaScript makes sense for a couple of reasons.
-
Static Typing was the most requested language feature in the State of JS Survey in both 2020 and 2021.
-
TypeScript is listed as the 4th most-used language in GitHub's State of the Octoverse.
From the Github repository:
ECMAScript proposal: Types as Comments
This proposal aims to enable developers to add type annotations to their JavaScript code, allowing those annotations to be checked by a type checker that is external to JavaScript. At runtime, a JavaScript engine ignores them, treating the types as comments.
© Ari Bandong.