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

러닝 타입스크립트

by 조시 골드버그, 고승원
January 2023
Beginner to intermediate
372 pages
8h 47m
Korean
Hanbit Media, Inc.
Content preview from 러닝 타입스크립트
96
1
개념
입을 함께 시도하면
never
키워드로 표시되는
never
타입이 됩니다.
type NotPossible = number & string; // 타입: never
never
키워드와
never
타입은 프로그래밍 언어에서
bottom
타입 또는
empty
타입을 뜻합니
다.
bottom
타입은 값을 가질 수 없고 참조할 수 없는 타입이므로
bottom
타입에 그 어떠한 타
입도 제공할 수 없습니다.
let notNumber: NotPossible = 0;
// ~~~~~~~~~// ~~~~~~~~~
// Error: Type 'number' is not assignable to type 'never'.// Error: Type 'number' is not assignable to type 'never'.
let notString: never = "";
// ~~~~~~~~~// ~~~~~~~~~
// Error: Type 'string' is not assignable to type 'never'.// Error: Type 'string' is not assignable to type 'never'.
대부분의 타입스크립트 프로젝트는
never
타입을 거의 사용하지 않지만 코드에서 불가능한 상
태를 나타내기 위해 가끔 등장합니다. 하지만 대부분 교차 타입을 ...
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