Javascript Number minus()

Description

Javascript Number minus()

Number.prototype.minus = function() {
    if ((arguments.length == 0) || (arguments.length > 1) || isNaN(arguments[0]))return;
    return Number(this.toString()) - Number(arguments[0].toString());
};

console.log(2);// w ww  .ja  v  a2 s.  c o  m
console.log((5).plus(2).minus(3));



PreviousNext

Related