01 / 05
any is a declaration of "no need to look"
When you do not know the type, writing any makes the error go away. But what went away is only the error — the problem is still sitting there.
Wherever you write any, TypeScript stops looking at all. Call a method that does not exist and it lets you through. The code below passes the type check and falls over when you run it.
const value: any = "Yui";console.log(value.toFixed(2));Result
TypeError: value.toFixed is not a function