(function (pro) { function plus(num) { return this.valueOf()+parseInt(num=num?num:0); } function minus(num) { return this.valueOf()-parseInt(num=num?num:0); } pro.plus = plus,pro.minus = minus; }(Number.prototype)); console.log((5).plus(3).minus(2));