blog

首页 / typescript / Avoid Object Wrapper Types (String, Number, Boolean, Symbol, BigInt)

Avoid Object Wrapper Types (String, Number, Boolean, Symbol, BigInt)

TypeScript models this distinction by having distinct types for the primitives and their object wrappers:

Things to Remember