일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- DFS
- 안드로이드
- 백준
- VIM
- 다이나믹 프로그래밍
- git
- CS
- java
- db
- frontend
- react
- BFS
- Python
- TypeScript
- 동적 계획법
- 자바
- LeetCode
- Database
- 그레이들
- DP
- Javascript
- Data Structure
- Redux
- Graph
- 프로그래머스
- 리트코드
- vscode
- network
- 알고리즘
- Algorithm
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