자바스크립트 객체의 property name은 string이거나 Symbol이다. 그러므로 string이나 Symbol이 아닌 다른 value로 객체의 property에 접근한다면 string으로 강제형변환된다. let object = {}; object['1'] = 'value'; console.log(object[1]); // 'value' 위에서 bracket notation으로 object[1]로 접근할 때, 1은 number 타입이므로 string으로 강제형변환된다. 즉 object['1'] 을 호출한 것과 동일하게 되어 'value' 를 출력한다. (참고) bracket notation이 아닌 dot notation으로 접근할 때는 syntax error가 발생한다. (e.g. object.1..
여러 타입의 객체를 배열로 다루기 예시 package com.Hazel; public class Main { public static void main(String[] args) { Buyer b = new Buyer(); b.buy(new TV()); b.buy(new Computer()); b.buy(new Audio()); b.summary(); } } class Product { int price; int bonuspoint; Product(int price) { this.price = price; bonuspoint = (int)(price / 10.0); } Product() {} } class TV extends Product { TV() { super(100); } public String..
- Total
- Today
- Yesterday
- 리덕스
- Session
- CSS
- 포인터 변수
- c언어
- oracle
- react
- useEffect
- rxjs
- 알고리즘
- jQuery
- til
- GIT
- linkedlist
- JavaScript
- Java
- package.json
- youtube data api
- Data Structure
- 제네릭스
- Redux
- getter
- Conflict
- 개발 공부
- this
- SQL
- 깃
- 인스턴스
- 자바
- Prefix Sums
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
