JavaScript???????????this???????
???????????? ???????[ 2017/3/20 10:30:16 ] ???????????? Javascript
????JavaScript????????????????????β????????????????????????????this ??arguments??this????????????з?????????????????????
????JavaScript???????????????????????????????????????????????????apply??????????Щ???????????????this????????
??????????????????????????????????????????????????????????????????????????????????this???????????????????????????????????????????????.???????[script]?±?????????????????????????????á?
var myObject = {
value: 0;
increment: function(inc){
this.value += typeof inc === 'number' ? inc : 1;
}
};
myObject.increment();
document.writeln(myObject.value);//1
myObject.increment(2);
document.writeln(myObject.value);//2
???????????????this????????????????????????????????this????????????????????????????ú????????this?????á????this??????????????????????????????????????
???????????????????????????????????????????????????????????????????? var sum = add(3?? 4);//sum??7
??????????????????????this????????????
??????????????????JavaScript????????????е??????????ζ???????????????????????????????????????
??????????????????new?????????????????????????????ú?????prototype????????????this???????????????????
????Apply???????????JavaScript????????????????????????????????????????з?????
????apply????????????????????????鰱????????ú???????????????????this?????
????apply???????????????????????????????this??????????????????????顣
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11