javascript - 关于原型prototype
天蓬老师
天蓬老师 2017-04-11 12:11:20
0
3
148

为什么下面代码的输出结果的情况会不一样:

var Box = {};
box.prototype.name = "xee";
box.prototype.study = {
   return this.name;
}
var box = new Box();
alert(box.prototype);  //结果是Undefiled
alert(box.constructor);  //这个却是 Object,constructor不也是要通过_proto_指针访问的吗?为什么他却不是Undefiled
天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

모든 응답(3)
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!