交叉类型
小于 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);
// 交叉类型
interface bird{
fly:string;
}
interface fish{
swim:string;
}
// 交叉类型,
type cross = bird & fish;
let test:cross = {
fly:"bird fly",
swim:"fish swim"
}
console.log(test);