TS Class

Creator
Creator
Seonglae ChoSeonglae Cho
Created
Created
2021 Apr 15 7:41
Editor
Edited
Edited
2025 Oct 16 12:55
Refs
Refs

TypeScript Overloading

Arguments must increase in order

TS Abstract Class

TS Abstract Modifier

Abstract members must be declared in abstract classes

TS Access Modifier

 
 
 
 
 
 
 
 
[Typescript] 클래스(Class) : private, protected, public
클래스 기반 객체 지향 언어가 지원하는 접근 제한자(Access modifier) public,private,protected를 지원하며 의미 또한 동일하다. 접근 제한자를 명시하지 않았을 때 - 다른 클래스 기반 언어 : protected로 지정 - typescript : public으로 지정 생성자 파라미터에도 접근 제한자를 선언할 수 있다. 접근 제한자가 사용된 생성자 파라미터는 암묵적으로 클래스 프로퍼티로 선언되고 생성자 내부에서 별도의 초기화가 없어도 암묵적으로 초기화가 수행된다.
[Typescript] 클래스(Class) : private, protected, public
[TypeScript]함수 오버로딩(Function Overloading)이란?
함수 오버로딩이란? TypeScript에서는 같은 이름을 가진 함수를 여러 개 정의할 수 있으며 각 함수는 서로 다른 타입을 가지는 매개변수로 정의해야 합니다. 매개변수가 다르며 이름이 동일한 함수를 함수 오버로딩이라고 합니다. 매개변수의 개수는 동일하지만, 타입이 다른 경우 // 함수 선언 function add(a: string, b: string): string; function add(a: number, b: number): number; // 함수 구현 function add(a: any, b: any): any { return a + b; } // 함수 호출 console.log(add(1, 2)); // 3 두 개의 함수 선언과 하나의 함수 구현이 있는 동일한 함수가 존재합니다. 첫 번째 함..
[TypeScript]함수 오버로딩(Function Overloading)이란?
velog.io
 
get and set in TypeScript
TypeScript uses getter/setter syntax that is like ActionScript3. class foo { private _bar: boolean = false; get bar(): boolean { return this._bar; } set bar(value: boolean) { this._bar = value; } } That will produce this JavaScript, using the ECMAScript 5 Object.defineProperty() feature.
get and set in TypeScript
 
 

Recommendations