Created
February 22, 2017 17:58
-
-
Save vipranarayan14/7758d836cfebc74964e6cd17d34ec4a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.between = function (a, b, inclusive = true) { | |
var min = Math.min(a, b), | |
max = Math.max(a, b); | |
return inclusive ? this >= min && this <= max : this > min && this < max; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment