From 27551435b651a2673e8d4f03d5b2c8f0750a0cec Mon Sep 17 00:00:00 2001 From: NetMan <13informatyka14@gmail.com> Date: Thu, 11 Jan 2024 10:08:59 +0100 Subject: [PATCH] Passed first test in exercise 09 Converting string to array, reversing array, reconverting array to string --- 09_palindromes/palindromes.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/09_palindromes/palindromes.js b/09_palindromes/palindromes.js index 8d21018..97bd050 100644 --- a/09_palindromes/palindromes.js +++ b/09_palindromes/palindromes.js @@ -1,5 +1,9 @@ -const palindromes = function () { - +const palindromes = function (string) { + const reversed = string.split("").reverse().join(""); + if (reversed === string) { + return true; + } + return false; }; // Do not edit below this line