interface和type的区别
相同点
interface Song1 {
song: string,
}
type Song2 = {
song: string
}
type Func1 = () => void
interface Func2 {
func2: () => void
}不同点
Last updated
interface Song1 {
song: string,
}
type Song2 = {
song: string
}
type Func1 = () => void
interface Func2 {
func2: () => void
}Last updated
interface Friend {
girl: number
}
interface Own extends Friend {
boy: number
}
type Name = {
name: string;
}
type User = Name & { age: number };