最新回答 / 慕無(wú)忌2387766
new 實(shí)例出來(lái)的函數(shù)會(huì)指向構(gòu)造器函數(shù)的prototype,所以是new構(gòu)造出的新實(shí)例的原型指向func.prototype。如:var trs=new func() 原型指向是 trs._proto_.constructor指向func.prototype
2019-02-09
最新回答 / 慕移動(dòng)9181930
不對(duì)也網(wǎng)上貼?如果沒用jquery就把<script>的內(nèi)容寫在結(jié)尾的</body>之前,以確保執(zhí)行腳本時(shí)dom元素全部加載完畢。否則,就會(huì)提示找不到元素哦
2018-12-20
最贊回答 / HelloG
function Person() - Function.prototype-Object.prototype-nullson -Person.prototype -Object.prototype -null
2018-12-06
最新回答 / White_Windmill
是傳入?yún)?shù)的原型指向賦值的參數(shù)
最新回答 / 慕俠2155777
function foo(){ this.b=100; return this.a; } var fff= foo.bind({a:1});? console.log(fff());//輸出1console.log(new fff());//輸出[object Object] console.log(new fff().b);//輸出100、、、、、、var greget=getX.bind(module);??console.log(greget());應(yīng)該報(bào)錯(cuò)module未...
2018-11-22
最贊回答 / sparrowhappy
我了解的有區(qū)別的,最明顯的區(qū)別:fn.bind()調(diào)用后不會(huì)立即執(zhí)行,需要再次調(diào)用才能執(zhí)行,call和apply的區(qū)別:fn.call() 接收的參數(shù)為字符串,apply是數(shù)組形式的參數(shù)
2018-10-16
最贊回答 / 慕粉0129131857
Student.prototype = {sayHi: function () {console.log("my name is " + this.name + "my age is " + this.age + "my class is " + this.classname);},learn: function (obj) {console.log(this.name + "is learning..." + obj);}}這一句不能這么寫,這樣等于把Student.prototype的值更改為后面所定...
2018-10-04
最新回答 / Elias丿純黑
get獲取的是modulus()這個(gè)方法,也就是最上邊那個(gè),你可以試試改改函數(shù)名,是一樣的。這個(gè)意思大致是:在o這個(gè)對(duì)象上添加一個(gè)叫做modulus的方法,這個(gè)方法調(diào)用modulus()這個(gè)方法
2018-09-13