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

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

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學習者快速成長!