Skip to Content
자바스크립트 완벽 가이드
book

자바스크립트 완벽 가이드

by David Flanagan, Han Seon- yong
February 2022
Beginner to intermediate
784 pages
24h 53m
Korean
Insight
Content preview from 자바스크립트 완벽 가이드
JavaScript
278
9장 클래스
this
에 접근해 새 객체를 초기화하기 전에 생성자에서 먼저 슈퍼클래스 생성자
를 호출해야 하지만, 메서드를 덮어 쓸 때는 그런 규칙이 적용되지 않습니다. 슈퍼
클래스 메서드를 덮어 쓰는 메서드가 슈퍼클래스 메서드를 호출할 필요는 없습니
다. 덮어 쓰는 메서드의 어디에서든
super
를 사용해 덮어 쓰인 메서드나 기타 슈퍼
클래스 메서드를 호출할 수 있습니다.
TypedMap 예제를 끝내기 전에, 이 클래스는 비공개 필드를 사용하기에 이상적
이라는 점을 짚고 넘어가겠습니다. 클래스를 만든 이후에 사용자가
keyType
이나
valueType
프로퍼티를 수정해 타입 체크를 망칠 수 있습니다. 비공개 필드가 지원
되면 이들 프로퍼티를
#keyType
과
#valueType
으로 바꿔서 외부에서 수정할 수 없
게 만들 수 있습니다.
9.5.3
󻯓󻱓󺇋󽴔󻖐󻙜
extends
키워드를 사용하면 서브클래스를 만들기 쉬워집니다. 하지만 만들기 쉽다
는 것이 서브클래스를 많이 만들어야 한다는 뜻은 아닙니다. 다른 클래스의 동작을
공유하는 클래스를 원한다면 서브클래스를 만들어 동작을 상속할 수도 있지만, 클
래스에서 다른 클래스의 인스턴스를 만들고 그 인스턴스에 여러분이 원하는 동작
을 위임하는 것이 더 쉽고 유연한 방법일 때도 많습니다. 다른 클래스의 래퍼를 ...
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

개발자를 위한 필수 수학

개발자를 위한 필수 수학

토머스 닐드
개발 7년차, 매니저 1일차

개발 7년차, 매니저 1일차

권원상, 한민주, 카미유 푸르니에

Publisher Resources

ISBN: 9788966263462