跳至主要內容

交叉类型

Entity小于 1 分钟

交叉类型

// 交叉类型

interface bird{
    fly:string;
}
interface fish{
    swim:string;
}
// 交叉类型,
type cross = bird & fish;
let test:cross = {
    fly:"bird fly",
    swim:"fish swim"
}
console.log(test);