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

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

關(guān)于數(shù)組數(shù)據(jù)存放問題

關(guān)于數(shù)組數(shù)據(jù)存放問題

慕桂英3389331 2019-04-14 10:42:37
varsalesOffices={};salesOffices.clientList=[];salesOffices.listen=function(key,fn){if(!this.clientList[key]){this.clientList[key]=[];}//我想問下這個(gè)this.clientList[key].push(fn)的表現(xiàn)形式是什么,//this.clientList[key]這是個(gè)數(shù)組然后往push,會成什么結(jié)果??//是這樣的嗎["squareMeter100",fucntion(){},"squareMeter80",fucntion(){},]returnthis.clientList[key].push(fn);}salesOffices.listen("squareMeter100",function(price){console.log("價(jià)格="+price);});salesOffices.listen("squareMeter80",function(price){console.log("價(jià)格="+price);});salesOffices.trigger=function(){varkey=Array.prototype.shift.call(arguments),fns=this.clientList[key];if(!fns||fns.length===0){returnfalse;}for(vari=0,fn;fn=fns[i++];){fn.apply(this,arguments);}}salesOffices.trigger("squareMeter100",200);salesOffices.trigger("squareMeter80",100);
查看完整描述

2 回答

?
一只斗牛犬

TA貢獻(xiàn)1784條經(jīng)驗(yàn) 獲得超2個(gè)贊

this.clientList是:
{
squareMeter100:[function(){}],
squareMeter80:[function(){}]
}
注意數(shù)組也是對象
                            
查看完整回答
反對 回復(fù) 2019-04-14
  • 2 回答
  • 0 關(guān)注
  • 425 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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