From cb5dbd8052ee82e1c7c829647f3bb6f7bc8d6997 Mon Sep 17 00:00:00 2001 From: DCoded <dicoded@email.com> Date: Mon, 26 Apr 2021 23:40:46 -0400 Subject: [PATCH] Replaced .capitalize() with .between() --- js/prototype.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/prototype.js b/js/prototype.js index dd69ae0ebe0..d14c281ce89 100644 --- a/js/prototype.js +++ b/js/prototype.js @@ -1,3 +1,9 @@ -String.prototype.capitalize = function() { - return this.charAt(0).toUpperCase() + this.substr(1); +/** + * Checks if the number is between two given values. + * @param {number} min The minimum value. + * @param {number} max The maximum value. + * @param {boolean} inclusive Whether or not to include the minimum and maximum values. + */ +Number.prototype.between = function(min, max, inclusive = false) { + return inclusive ? this >= min && this <= max : this > min && this < max; }; -- GitLab