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

為了賬號安全,請及時綁定郵箱和手機立即綁定

bind方法不是棄用了嗎?

bind方法不是棄用了嗎?

正在回答

2 回答

jquery的事件綁定方法.bind(),和視頻所講的js原生修改函數(shù)this指向的.bind(),是兩個東西啊。大兄弟,你會不會把這兩者混淆了~

0 回復 有任何疑惑可以回復我~

bind?函數(shù)在 ECMA-262 第五版才被加入;它可能無法在所有瀏覽器上運行。你可以部份地在腳本開頭加入以下代碼,就能使它運作,讓不支持的瀏覽器也能使用 bind() 功能。

if (!Function.prototype.bind) {
?Function.prototype.bind = function (oThis) {
? ?if (typeof this !== "function") {
? ? ?// closest thing possible to the ECMAScript 5
? ? ?// internal IsCallable function
? ? ?throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")
? ?}

? ?var aArgs = Array.prototype.slice.call(arguments, 1),
? ? ?fToBind = this,
? ? ?fNOP = function () {},
? ? ?fBound = function () {
? ? ? ?fBound.prototype = this instanceof fNOP ? new fNOP() : fBound.prototype ? ? ? ?return fToBind.apply(this instanceof fNOP
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? this
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? : oThis || this,
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? aArgs.concat(Array.prototype.slice.call(arguments)))
? ? ? ?}
? ?if( this.prototype ) {
? ? ?// Function.prototype doesn't have a prototype property
? ? ?fNOP.prototype = this.prototype ? ?}

? ?return fBound ?}}

1 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

bind方法不是棄用了嗎?

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

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

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