blog
View On GitHub
首页
/ typescript
Typescript
Understand the Relationship Between TypeScript and JavaScript
Know Which TypeScript Options You’re Using
Understand That Code Generation Is Independent of Types
Get Comfortable with Structural Typing
Limit Use of the any Type
Use Your Editor to Interrogate and Explore the Type System
Think of Types as Sets of Values
Know How to Tell Whether a Symbol Is in the Type Space or Value Space
Prefer Type Annotations to Type Assertions
Avoid Object Wrapper Types (String, Number, Boolean, Symbol, BigInt)
Distinguish Excess Property Checking from Type Checking
Apply Types to Entire Function Expressions When Possible
Know the Differences Between type and interface
Use readonly to Avoid Errors Associated with Mutation
Use Type Operations and Generic Types to Avoid Repeating Yourself
Prefer More Precise Alternatives to Index Signatures
Avoid Numeric Index Signatures