shenchao890216 / shenchao890216.github.io

0 stars 0 forks source link

TypeScript Learning 7 - 高级类型 | SCRDCOOL #6

Open shenchao890216 opened 2 years ago

shenchao890216 commented 2 years ago

https://blog.scrdcool.com/2019/09/25/tslearning7/

交叉类型字面理解是取类型的两个交集,而实际是取两个类型的并集,例如: 123456789101112interface DogInterface { run(): void}interface CatInterface { eat(): void}let pet: DogInterface & CatInterface = { ru