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
161
아이템 28 유효한 상태만 표현하는 타입을 지향하기
function getStickSetting(controls: CockpitControls) {
const {leftSideStick, rightSideStick}
=
controls;
if (leftSideStick
===
0) {
return rightSideStick;
} else if (rightSideStick
===
0) {
return leftSideStick;
}
if (Math.abs(leftSideStick
-
rightSideStick) < 5) {
return (leftSideStick + rightSideStick) / 2;
}
// ???
}
그러나 두 스틱의 각도가 매우 다른 경우는 해결하기 어렵습니다. 그렇다고 해
결책 없이 조종사에게 오류를 띄운다는 것은 현실적으로 불가능한 일입니다.
비행 중이기 때문에 스틱의 각도는 어떻게든 설정되어야 합니다.
한편, 비행기가 폭풍에 휘말리자 부기장은 조용히 사이드 스틱을 뒤로 당겼
습니다. 고도는 올라갔지만 결국은 속력이 떨어져서, 스톨(양력을 잃고 힘없이
떨어지는) 상태가 되었고 곧이어 비행기는 추락하기 시작했습니다.
조종사들은 비행 중 스톨 상태에 빠지면, 스틱을 앞으로 밀어 비행기가 하강
하면서 속력을 다시
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