復制代碼 代碼如下:
var doubling=function(x){
return x*2;
};
var obj={
val:100,
};
復制代碼 代碼如下:
var obj={val:100,
prop:function(){
var that=this;
document.write('name: '+that+'; type: '+typeof(that)+'<br/>');
return doublling(that.val);
}(),
get_prop:function(){
var that=this;
document.write('name: '+that+'; type: '+typeof(that)+'<br/>');
return doublling(that.val);
},
};
新聞熱點
疑難解答