일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- 화살표2개
- ignore padding
- 리액트
- react
- tailwindCSS
- useQueryClient
- BFC
- Carousel
- CustomHook
- vite
- 부모요소의 패딩 무시
- debouncing
- transition
- alias설정
- 서초구보건소 #무료CPR교육
- 문제해결
- twoarrow
- DOM
- BlockFormattingContext
- es6
- 제어컴포넌트
- 조건부스타일
- createPortal
- QueryClient
- 이즐 #ezl #욕나오는 #교통카드
- accordian
- 부모패딩
- parent padding
- 함수형프로그래밍
- ?? #null병합연산자
- Today
- Total
목록2025/07/05 (2)
프론트엔드 첫걸음
생성자 파라미터에 접근제어자 붙여 클래스 속성 선언과 초기화를 한번에 할 수 있는 타입스크립트의 문법적 설탕.class Point { constructor(public x: number, public y: number) { // 여기서 this.x = x; this.y = y; 를 안 써도 자동 처리 }}const p = new Point(10, 20);console.log(p.x); // 10console.log(p.y); // 20생성자 파라미터에 public/private/protected를 붙이면 자동으로 클래스 속성이 만들어지고 this에 할당된다.JavaScript가 아니라 TypeScript 컴파일러가 해주는 문법적 설탕(syntax sugar) 아래와 사실상 동일class Poin..
코드 출처 - 드림코딩 엘리 -------------------------------1. 일반 생성자 방식class CoffeeMaker { constructor(public coffeeBeans: number) {}}const maker = new CoffeeMaker(10); 2. 팩토리 메서드 방식class CoffeeMaker { private constructor(public coffeeBeans: number) {} static makeMachine(coffeeBeans: number): CoffeeMaker { console.log("머신 초기화 중..."); return new CoffeeMaker(coffeeBeans); }}const maker = CoffeeMaker..