JAVASCRIPT에서 PROTOTYPE과 GETPROTOTYPEOF에 대해서 질문드립니다.
252
donghyun lee
작성한 질문수 2
0
function ParentClass() {};
function ChildClass() {};
ChildClass.prototype = new ParentClass();
var mychild = new ChildClass();
var myparent = new ParentClass();
console.log(mychild);
console.log(myparent);
console.log(mychild.prototype);
console.log(myparent.prototype);
console.log(Object.getPrototypeOf(mychild));
console.log(Object.getPrototypeOf(myparent));
-> 위 예시에서 결과 값은 아래와 같습니다.
ParentClass {}
ParentClass {}
undefined
undefined
ParentClass {}
{}
1) 어떻게 console.log(mychild); 와 console.log(myparent); 의 값이 같게 나올수가 있나요....?
2) console.log(Object.getPrototypeOf(mychild));와 console.log(Object.getPrototypeOf(myparent));
의 결과값이 각각 ChildClass()와 ParentClass();여야 하는거 아닌가요...?
답변 0
존재하지 않는 일기 url입력 시 alert이 두 번 떠요
0
17
1
useState 직접 구현 부분에서 질문이 있습니다.
1
20
1
학습을 하고 블로그에 정리를 해도 괜찮을까요?
1
23
1
교재(3쇄)와 강의 내용 문의
0
28
2
섹션2번 부분 강의 화면이 잘 못된것 같아서 문의합니다.
0
23
1
call stack 표현이 잘못표현된것이 아닌가요?
0
64
2
React 와 Virtual DOM 의 이야기 영상 실행이 안됩니다.
0
34
1
일반 강의와 차이점?
1
53
1
!= 연산자의 역할
0
35
1
중요하진 않지만 설명하신부분에서 안된부분..
1
37
1
강의 듣는 순서가 어떻게 되나요?
0
49
1
stopPropagation()에 대해서 질문 있습니다.
0
50
2
12.13) 하단 여백 스타일링 관련 질문 드립니다.
0
65
2
27강 Context내 RSC 사용 관련 문의
0
85
3
혹시 다음 강의 제작 예정된 것들이 있을까요?
0
80
1
Enable Linting 항목을 찾을수가 없습니다.
0
46
2
에러 질문드립니다
0
63
2
1강 질문
0
70
2
윈도우에서는동작줄이기가어디에있을까요??
0
34
1
백오피스를 개발할 때 아키텍처 구성에 대한 질문
0
58
3
ai가 만든 강의인가요?
0
146
1
VSCode 설정 문의
0
66
2
PPT 코드 관련 질문
0
48
2
state 객체로 묶기
0
47
1





