Number.prototype.plus = function (num) { // 注:箭头函数会将this指向window
return this + num
}
Number.prototype.minus = function (num){
return this - num
}
var a = (5).plus(3).minus(6);
console.log(a)
/* 什么时候不能使用this**/
https://zhuanlan.zhihu.com/p/26540168
实现如下语法的功能:var a = (5).plus(3).minus(6); //2
最新推荐文章于 2022-01-21 11:25:25 发布