interface Square {
color :string,
width :number,
}
let 네모 :Square = { color : 'red', width : 100 }
장점: extends가 가능
interface Student {
name :string,
}
interface Teacher extends Student {
age :number
}
interface Animal {
name :string
}
interface Cat extends Animal {
legs :number
}
type Animal = {
name :string
}
type Cat = Animal & { legs: number }