Nodejs Number Between between()

Here you can find the source of between()

Method Source Code

/******************************************************************************
Useful helper functions for different number manipulations
Copyright (C) 2010 The Otrax Project / Lukas Diener

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*******************************************************************************/

/* check of a number is between the two arguments */
Number.prototype.between = function() {
  return this > arguments[0] && this < arguments[1];
};

Related

  1. between( a, b )
    Number.prototype.between = function( a, b ) {
        return a <= this && b >= this ||
               b <= this && a >= this;
    
  2. between(a, b)
    Number.prototype.between = function(a, b) {
      var min = Math.min.apply(Math, [a, b]),
        max = Math.max.apply(Math, [a, b]);
      return this > min && this < max;
    };
    
  3. between(a, b)
    Number.prototype.between = function(a, b){
      return (this >= a && this < b);
    function getDirection(ox, oy, tx, ty){
      var dx = tx - ox;
      var dy = ty - oy;
      var rad = Math.atan2(dx, dy);
      var degree = (rad*180)/Math.PI;
      if( degree < 0 ) degree += 360;
    ...
    
  4. between(a, b, inclusive)
    Number.prototype.between = function (a, b, inclusive) {
        var min = Math.min.apply(Math, [a, b]),
            max = Math.max.apply(Math, [a, b]);
        return inclusive ? this >= min && this <= max : this > min && this < max;
    };
    
  5. between(a, b, inclusive)
    http:
    Number.prototype.between = function (a, b, inclusive) {
        var min = Math.min.apply(Math, [a,b]),
            max = Math.max.apply(Math, [a,b]);
        return inclusive ? this >= min && this <= max : this > min && this < max;
    };