Here you can find the source of between()
/****************************************************************************** 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]; };
Number.prototype.between = function( a, b ) { return a <= this && b >= this || b <= this && a >= this;
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; };
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; ...
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; };
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; };