일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 자바
- 리트코드
- Data Structure
- db
- LeetCode
- 백준
- frontend
- java
- VIM
- vscode
- 그레이들
- DP
- Algorithm
- 안드로이드
- 프로그래머스
- Javascript
- react
- network
- Database
- DFS
- 알고리즘
- Graph
- CS
- Python
- BFS
- TypeScript
- git
- Redux
- 동적 계획법
- 다이나믹 프로그래밍
Archives
- Today
- Total
목록Prototype (1)
늘 겸손하게
JavaScript - prototype & prototype chaining
prototype prototype = 원형 상속받으려는 객체의 원형을 알려주는 속성. 상속 받으려는 객체를 속성에 할당하여 부모 객체를 선언할 수 있다. function Ultra(){} Ultra.prototype.ultraProp = true; function Super(){} Super.prototype = new Ultra(); function Sub(){} Sub.prototype = new Super(); var o = new Sub(); console.log(o.ultraProp); 위 코드를 실행하면 true가 출력된다. 변수 o는 Sub객체를 저장한다. Sub는 Super 객체를 상속받음 Super는 Ultra객체를 상속받음 Ultra의 prototype 속성의 ultraProp 속성에..
Programming/JavaScript
2022. 8. 12. 14:39