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.
This commit is contained in:
parent
9a40c04726
commit
4ab845b9c6
|
@ -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("")
|
||||
|
|
Loading…
Reference in New Issue