Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 스프링 빈
- 리눅스
- 문자열
- java 백준 1차원 배열
- 카카오
- 반복문
- 백준 java
- Java
- 자바스크립트 코딩의 기술
- 명령어
- 자바
- map
- 코딩테스트
- 프로그래머스
- 리눅스마스터 1급 정리
- Kotlin
- 월간코드챌린지
- 리눅스마스터1급
- 개발자 회고록
- 코테
- Memoir
- 연습문제
- 백준 javascript
- 스프링 컨테이너
- JavaScript
- toCharArray
- 고잉버스
- 리눅스마스터 3과목
- Linux
- GoingBus
Archives
- Today
- Total
728x90
목록 이터레이터 (1)
728x90
728x90
hoon DevLog

8장 클래스로 인터페이스를 간결하게 유지하라 tip40. get과 set으로 인터페이스를 단순하게 만들어라 이전 팁에서 사용한 코드를 활용하여, 클래스는 아래 코드처럼 속성에 접근하여 변경도 가능하다. class Coupon { constructor(price, expiration) { this.price = price; this.expiration = expiration || '2주'; } getPriceText() { return `$ ${this.price}`; } getExpirationMessage() { return `이 쿠폰은 ${this.expiration} 후에 만료됩니다.`; } } const coupon = new Coupon(5); coupon.price = '$10'; coupon..
IT/Javascript
2024. 2. 29. 09:23