Skip to Content
이펙티브 타입스크립트
book

이펙티브 타입스크립트

by Dan Vanderkam, Won Ho Jang
November 2021
Intermediate to advanced
364 pages
9h 52m
Korean
Insight
Content preview from 이펙티브 타입스크립트
TypeScript
51
아이템 8 타입 공간과 값 공간의 심벌 구분하기
··
값으로 쓰이는
this
는 자바스크립트의
this
키워드입니다(아이템 49). 타
입으로 쓰이는
this
는, 일명 ‘다형성(polymorphic)
this
’라고 불리는
this
의
타입스크립트 타입입니다. 서브클래스의 메서드 체인을 구현할 때 유용합
니다.
··
값에서
&
와
|
는 AND와 OR 비트연산입니다. 타입에서는 인터섹션과 유니온
입니다.
··
const
는 새 변수를 선언하지만,
as const
는 리터럴 또는 리터럴 표현식의 추
론된 타입을 바꿉니다(아이템 21).
··
extends
는 서브클래스(
class A extends B
) 또는 서브타입(
interface A ex
tends B
) 또는 제너릭 타입의 한정자(
Generic<T extends number>
)를 정의
할 수 있습니다.
··
in
은 루프(
for (key in object)
) 또는 매핑된(mapped) 타입에 등장합니다.
타입스크립트 코드가 잘 동작하지 않는다면 타입 공간과 값 공간을 혼동해
서 잘못 작성했을 가능성이 큽니다. 예를 들어, 단일 객체 매개변수를 받도록
email
함수를 변경했다고 생각해 보겠습니다.
function email(options: {person: Person, subject: string, ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

러닝 타입스크립트

러닝 타입스크립트

조시 골드버그
고성능 파이썬(2판)

고성능 파이썬(2판)

오현석, 미샤 고렐릭, 이안 오스발트
타입스크립트 프로그래밍

타입스크립트 프로그래밍

Boris Czerny, U Jung Eun

Publisher Resources

ISBN: 9788966263134