Javascript Number sum(a)
Number.prototype.sum = function (a) { return a = a || 0,this + a; } num = 4;// w ww . ja v a 2 s . c o m num.sum(4).sum(5).sum(6);