6 ms·
Adding types to code that was written with `any` is going to be much harder than using `unknown`.
by schwartzworld 4y ago
Adding types to code that was written with `any` is going to be much harder than using `unknown`.
- bazoom42 4y agoThe point is if you have existing JavaScript you want to integrate with TypeScript. You should not need ‘any’ in code written in TypeScript from the beginning.
- schwartzworld 4y agoSure, but at least with unknown you will have done some narrowing. Writing Typescript well requires some fundamentally different patterns than javascript. Adding types afterward is like pulling out your teeth slowly.