From 4ab845b9c6a824d0c21972361f9388b6d3cc1e34 Mon Sep 17 00:00:00 2001 From: Pedro Ribeiro <67191639+MrBlamz@users.noreply.github.com> Date: Tue, 27 Apr 2021 10:23:37 +0100 Subject: [PATCH] Update palindromes.js Since we use toLowerCase() before using replace there is no need to use A-Z in our regex cause it will be impossible to have uppercase characters in the string. --- palindromes/palindromes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/palindromes/palindromes.js b/palindromes/palindromes.js index 19b6aa8..0023222 100644 --- a/palindromes/palindromes.js +++ b/palindromes/palindromes.js @@ -1,5 +1,5 @@ const palindromes = function(string) { - processedString = string.toLowerCase().replace(/[^A-Za-z]/g, ""); + processedString = string.toLowerCase().replace(/[^a-z]/g, ""); return ( processedString .split("")