Javascript Number add(n)

Description

Javascript Number add(n)


'use strict';/*w  w w  . ja v  a 2s .  c  o  m*/

Number.prototype.add = function(n){
  return this + n;
}
var n = 5;
console.log(n.add(2));

console.log((1).add(2));



PreviousNext

Related