타입가드와 차별된 타입
let pet = getSmallPet();
// 이러한 각 프로퍼티 접근은 오류를 발생시킵니다.
if (pet.swim) {
pet.swim();
} else if (pet.fly) {
pet.fly();
}Last updated
Was this helpful?
let pet = getSmallPet();
// 이러한 각 프로퍼티 접근은 오류를 발생시킵니다.
if (pet.swim) {
pet.swim();
} else if (pet.fly) {
pet.fly();
}Last updated
Was this helpful?
Was this helpful?