Skip to Content
러닝 타입스크립트
book

러닝 타입스크립트

by 조시 골드버그, 고승원
January 2023
Beginner to intermediate
372 pages
8h 47m
Korean
Hanbit Media, Inc.
Content preview from 러닝 타입스크립트
93
4
객체
} else {
console.log('It rhymes: ${poem.rhymes}');
}
poem.type; // 타입: 'pages' | 'rhymes'
poem.pages;
// ~~~~~// ~~~~~
// Error: Property 'pages' does not exist on type 'Poem'.// Error: Property 'pages' does not exist on type 'Poem'.
// Property 'pages' does not exist on type 'PoemWithRhymes'.// Property 'pages' does not exist on type 'PoemWithRhymes'.
판별된 유니언은 우아한 자바스크립트 패턴과 타입스크립트의 타입 내로잉을 아름답게 결합하
므로 타입스크립트에서 필자가 가장 좋아하는 기능입니다.
10
장 ‘제네릭’과 관련된 프로젝트에
서 제네릭
generic
데이터 운영을 위해 판별된 유니언을 사용하는 방법을 자세히 살펴봅니다.
4.4
교차 타입 교차 타입
타입스크립트 유니언 타입은 둘 이상의 다른 타입 중 하나의 타입이 될 수 있음을 나타냅니다.
자바스크립트의 런타임
|
연산자가
&
연산자에 대응하는 역할을 하는 것처럼, 타입스크립트에
서도
&&
교차 타입교차 타입
intersection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
견고한 데이터 엔지니어링

견고한 데이터 엔지니어링

조 라이스, 맷 하우슬리
파이썬으로 살펴보는 아키텍처 패턴

파이썬으로 살펴보는 아키텍처 패턴

오현석, 해리 퍼시벌, 밥 그레고리

Publisher Resources

ISBN: 9791169210638