Static typing reports certain classes of error in your program at compile (aka "transpile") time. This reduces the number of tests you need to write and gives you more confidence about the correctness of your code than is possible with dynamic typing.
The alternative is finding out some time later (possibly in production) that your function that had always been assuming the arguments were non-null strings suddenly generates an error when it gets passed in null or a number or object or similar.
TypeScript is a huge productivity boost for JavaScript programmers (and similarly mypy for Python). There's no way I'd be happy working with either language without these tools. TypeScript is also useful on the backend, if you're using Node.
Comments
Static typing reports certain classes of error in your program at compile (aka "transpile") time. This reduces the number of tests you need to write and gives you more confidence about the correctness of your code than is possible with dynamic typing.
The alternative is finding out some time later (possibly in production) that your function that had always been assuming the arguments were non-null strings suddenly generates an error when it gets passed in null or a number or object or similar.
TypeScript is a huge productivity boost for JavaScript programmers (and similarly mypy for Python). There's no way I'd be happy working with either language without these tools. TypeScript is also useful on the backend, if you're using Node.
But the node core devs have moved on to deno. They also recently ripped out their TS code. Skate to where the puck will be.