Add caution to Any Type documentation (#30412)
This commit is contained in:
committed by
Christopher McCormack
parent
f86f39a97e
commit
28b92c31a7
@ -6,6 +6,8 @@ title: Any Type
|
||||
|
||||
The Any type instructs Typescript to suspend type checking for the specified variables. Useful when working with dynamic content for which you don't know the type, and for transitioning your codebase from Javascript to Typescript in pieces. You can use Javascript's implicit typing with variables declared with a type of Any.
|
||||
|
||||
Although the Any type can be helpful in specific circumstances, it should be used with caution, since it means we opt out of TypeScript's typechecking.
|
||||
|
||||
```typescript
|
||||
let notSure: any = 4;
|
||||
notSure = "maybe a string instead";
|
||||
|
Reference in New Issue
Block a user