Nodejs Number Calculate equals(another)

Here you can find the source of equals(another)

Method Source Code

Number.prototype.equals = function (another) {
    return this - another === 0;
};

Related

  1. digits()
    Number.prototype.digits = function() {
        return (Math.floor(this)+"").replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,");
    };
    
  2. discountPercentage(val)
    Number.prototype.discountPercentage = function(val){
      return this - this.percentage(val);
    };
    
  3. div10()
    Number.prototype.div10 = function () {
      return this/10;
    Object.prototype.say = function (s) {
     console.log('I say ' + s);
    var o = {};
    o.say("Hello");
    var n = 120;
    ...
    
  4. double()
    Number.prototype.double = function() {
      return this * 2;
    };
    
  5. doubleDigitalize()
    "use strict";
    Number.prototype.doubleDigitalize = function() {
      const numberString = this.toString();
      return numberString.length < 2 ? "0" + numberString : numberString;
    };
    
  6. exp()
    Number.prototype.exp = function() {
      return Math.exp(this);
    };
    
  7. fe(x)
    Number.prototype.fe = function(x)
      var s = x.toString();
      var point = s.search(/\./);
      if (point == -1)
        return (Math.abs(this - x) < 0.5);    
      else
    ...
    
  8. fillZero(len)
    Number.prototype.fillZero = function (len)
      var s = this.toString(10);
      while (s.length<len) s = "0" + s;
      return s;
    
  9. firstDigit()
    Number.prototype.firstDigit = Number.prototype.firstDigit || function () {
      let number = this;
      while (number >= 10) {
        number = Math.floor(number / 10);
      return number;
    };