冷酷薯片

文章
4
资源
0
加入时间
3年1月10天

Typescript学习 类型守卫

in 关键字interface Admin { name: string privileges: string[]}interface Employee { name: string startDate: Date}type UnKnownEmployee = Employee | Adminfunction printEmployeeInformation(emp: UnKnownEmployee) { console.log("Name: "