第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

原型鏈還是搞不懂

老師,

這個(gè)prototype里的constructor屬性有什么用處;

還有這些,

function person(){}
undefined
function student(){}
undefined
student.prototype = new person()
Object {? }
student.prototype.constructor
function person()
student.prototype.constructor = student()
undefined
student.prototype.constructor
undefined
student.prototype.constructor = student
function student()
student.prototype.constructor
function student()
var bosn = new student()
undefined
bosn instanceof person
true
person.prototype
Object { , 等 1 項(xiàng)… }
person.prototype.constructor
function person()
function one(){}
undefined
student.prototype.constructor
function student()
student.prototype.constructor = one
function one()
bosn instanceof person
true
bosn instanceof one
false
one.s = 9
9
bosn.s
undefined
student.prototype = new one()
Object {? }
bosn.s
undefined
bosn instanceof one
false
bosn instanceof person
true
student.prototype
Object {? }
bosn.z
undefined
person.z
undefined
person.prototype.z
undefined
person.prototype.z = 3
3
person.prototype.z
3
bosn.z
3
bosn.s
undefined
student.prototype
Object {? }
student.prototype.toString
function toString()
student.prototype.constructor
function one()
student.prototype = new one()
Object {? }
var v = new student()
undefined
v instanceof one
true
bosn instanceof one
false
bosn instanceof peoson
ReferenceError: peoson is not defined
bosn instanceof person
true
bosn.prototype = new one()
Object {? }
bosn instanceof person
true
bosn.prototype
Object {? }
bosn.prototype.constructor
function one()

為什么bosn instanceof person是true? 我明明把student.prototype改了 ? ? 為什么還是指向person

正在回答

2 回答

。。。。。。。。。。。

0 回復(fù) 有任何疑惑可以回復(fù)我~

你最好是截屏,而不是復(fù)制,這樣一大段什么格式都沒有,別人看不懂是什么的。所以才沒有人回答你。

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

愛代碼_愛前端 提問者

thanks
2015-05-01 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
JavaScript深入淺出
  • 參與學(xué)習(xí)       281098    人
  • 解答問題       1047    個(gè)

由淺入深學(xué)習(xí)JS語言特性,且解析JS常見誤區(qū),從入門到掌握

進(jìn)入課程

原型鏈還是搞不懂

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)