카페검색 본문
카페글 본문
-
[초등학교 영어 동화 이야기 동영상 감상 3] 3. Over The Moon 2023.09.30해당카페글 미리보기
refuses to accept this, and slips into depression, causing all the light in Lunaria to be put out. Fei Fei tries to console Changé but she too is overcome by sadness due to a vision of her mother who passed away years back. Changé and...
-
[안나 카레니나_PART 7] Chap 2_10월 10일(화) 2023.10.09해당카페글 미리보기
단 한 번도 없었어.“ ”정말이에요?“ 그녀는 그의 눈을 응시하며 물었다. He had said it without thinking, simply to console her. But when he glanced at her and saw those sweet truthful eyes fastened questioningly on him, he repeated it...
-
타입스크립트에서 싱글톤 패턴 사용하기 2023.10.09해당카페글 미리보기
this.id = 'd2'; // readonly이기 때문에 접근 불가능 this.employees.push(employee); } printEmployeeInformation() { console.log(this.employees.length); console.log(this.employees); } } class ITDepartment extends Department { constructor(id...
-
타입스크립트에서 추상 클래스 사용하기 2023.10.09해당카페글 미리보기
this.id = 'd2'; // readonly이기 때문에 접근 불가능 this.employees.push(employee); } printEmployeeInformation() { console.log(this.employees.length); console.log(this.employees); } } class ITDepartment extends Department { constructor(id...
-
타입스크립트에서 타입 가드와 타입 캐스팅 사용하기 2023.10.11해당카페글 미리보기
return a + b; } type UnknownEmployee = Employee | Admin; function printEmployeeInformation(emp: UnknownEmployee){ console.log('Name: ' + emp.name); if('privileges' in emp){ console.log('Privileges: ' + emp.privileges); } if('startDate...
-
타입스크립트에서 상속 사용하기 2023.10.09해당카페글 미리보기
return { name: name }; } // 메소드 // ``을 사용하면 ${}를 사용하여 변수를 사용할 수 있음 describe(this: Department) { console.log(`Department (${this.id}): ${this.name}`); } addEmployee(employee: string) { //this.id = 'd2'; // readonly...
-
타입스크립트에서 데코레이터 사용하기 2023.10.12해당카페글 미리보기
// 데코레이터는 클래스, 프로퍼티, 메소드, 게터/세터, 파라미터에 사용할 수 있다. function Logger(logString: string) { console.log('LOGGER FACTORY'); return function(constructor: Function) { console.log(logString); console.log(constructor...
-
타입 스크립트에서 인덱스 타입과 함수 오버로드 사용하기 2023.10.11해당카페글 미리보기
string' || typeof b === 'string'){ return a.toString() + b.toString(); } return a + b; } const result = add(1, 5); console.log(result); // 타입 변환을 통해 오류 해결 as string; // 함수 오버로드를 통해 오류 해결 const result2 = add('Max...
-
타입스크립트에서 인터페이스 사용하기 2023.10.09해당카페글 미리보기
constructor(n?: string){ if(n){ this.name = n; } } greet(phrase: string){ if(this.name){ console.log(phrase + ' ' + this.name); } else { console.log('생성자에 매개변수가 없는 경우 '); } } } let user1: Greetable; user1 = new Person...
-
useMemo 사용하기 2023.10.01해당카페글 미리보기
된 값을 꺼내와 사용한다. 2. useMemo 예제 import { useState } from "react"; const hardCalculate = (number) => { console.log("어려운 계산!"); for (let i = 0; i < 99999999; i++) {} // 생각하는 시간 return number + 10000; }; const...