From 2fab5760d7e962d65158b0f295ab9920985b0066 Mon Sep 17 00:00:00 2001 From: Vladimir Gankin Date: Mon, 18 Nov 2024 10:35:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D1=8F=D0=B5=D1=82=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=BB=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/functions.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/functions.js b/js/functions.js index 4b56464..47f6aad 100644 --- a/js/functions.js +++ b/js/functions.js @@ -3,15 +3,15 @@ function isLesserOrEqual(string, maxLength) { } function isPalindrome(string) { - let normalizedString = string.replaceAll(" ", "").toLowerCase(); - let reversedString = normalizedString.split("").reverse().join(""); + const normalizedString = string.replaceAll(' ', '').toLowerCase(); + const reversedString = normalizedString.split('').reverse().join(''); return normalizedString === reversedString; } function toPositiveNumber(string) { - let normalizedString = string.toString().replaceAll(" ", ""); - let result = ""; + const normalizedString = string.toString().replaceAll(' ', ''); + let result = ''; for (let i = 0; i < normalizedString.length; i++) { if(!isNaN(Number(normalizedString[i]))) { @@ -19,6 +19,6 @@ function toPositiveNumber(string) { } } - return parseInt(result); + return parseInt(result, 10); }