在此列中,将构造函数的constructor指向一个字符串后,其构造函数为字符串,那么developer.constructor.prototype就应该为undefined,但实例为什么仍能访问其构造函数原型链上的属性
var monkey = {
feeds:'bananas',
breathes:'air'}function Human(){}
Human.prototype = monkey;var developer = new Human();
developer.constructor = 'junk'developer.breathes ; //"air"monkey.test =1;
developer.test;
Qyouu
米琪卡哇伊
随时随地看视频慕课网APP
相关分类