Nodejs Number Calculate send(method)

Here you can find the source of send(method)

Method Source Code

Number.prototype.send = function(method) {
  return this[method].call();
};

Related

  1. reprLocale()
    Number.prototype.reprLocale = function () {
        var result,
            digits = (arguments.length > 0)? arguments[0] : undefined,
            number = String(this.repr(digits)),
            int = number.split(".")[0],
            intparts = [],
            float = (number.indexOf(".") >= 0)? number.split(".")[1] : undefined;
        while (int.length > 0) {
            if (int.length <= 3) {
    ...
    
  2. reverse()
    Number.prototype.reverse = function() {
      return parseInt(this.toString().split('').reverse().join(''), 10);
    
  3. rnd2()
    Number.prototype.rnd2 = function () {
      return Math.round(this.valueOf() * 100) / 100;
    
  4. rotate()
    Number.prototype.rotate = Number.prototype.rotate || function () {
      return Math.floor((this / 10) + ((this % 10) * Math.pow(10, exports.digitLength(this) - 1)));
    };
    
  5. safeDivideBy(x)
    Number.prototype.safeDivideBy = function(x) {
        var result = this.valueOf() / x;
        if(result === Infinity) {
            return 0;
        else {
            return result;
    
  6. separatorsseparators()
    Number.prototype.separators = function separators(){
      var string = this.toString();
      var x      = string.split('.');
      var x1     = x[0];
      var x2     = x.length > 1 ? '.' + x[1] : '';
      var regex  = /(\d+)(\d{3})/;
      while (regex.test(x1)) {
          x1 = x1.replace(regex, '$1' + ',' + '$2');
      return x1 + x2;
    };
    
  7. set(key, value)
    'use strict';
    const assert = require('assert');
    const nan = Symbol('NaN');
    const define = Object.defineProperty;
    Number.prototype[nan] = Object.create(null);
    Number.prototype.set = function (key, value) {
      if (null == this || !isNaN(this)) { return this; }
      const space = this[nan];
      const accessor = {
    ...
    
  8. setInCirclesetInCircle(lower, upper)
    Number.prototype.setInCircle = function setInCircle(lower, upper){
      var zahl = this;
      if (lower === upper){
        return lower;
      if (lower > upper){
        var l = lower;
        lower = upper;
        upper = l;
    ...
    
  9. setInRangesetInRange(lower, upper)
    Number.prototype.setInRange = function setInRange(lower, upper){
      if (typeof lower === "undefined" || lower === null){
        lower = this;
      if (typeof upper === "undefined" || upper === null){
        upper = this;
      lower = parseFloat(lower) || 0;
      upper = parseFloat(upper) || 0;
    ...