Hacker News new | past | comments | ask | show | jobs | submit login

‘any’ is great for porting javascript into typescript, and integrating with javascript libraries. You can add types gradually, without everything grinding to a halt.



Adding types to code that was written with `any` is going to be much harder than using `unknown`.


The 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.


Sure, 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.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: