Use const for palindrome solution variable (#439)

This commit is contained in:
MaoShizhong
2024-03-03 01:44:34 +00:00
committed by GitHub
parent f215901131
commit 461c852f98
@@ -1,6 +1,6 @@
const palindromes = function (string) { const palindromes = function (string) {
// Since we only consider letters and numbers, create a variable containing all valid characters // Since we only consider letters and numbers, create a variable containing all valid characters
let alphanumerical = 'abcdefghijklmnopqrstuvwxyz0123456789'; const alphanumerical = 'abcdefghijklmnopqrstuvwxyz0123456789';
// Convert to lowercase, split to array of individual characters, filter only valid characters, then rejoin as new string // Convert to lowercase, split to array of individual characters, filter only valid characters, then rejoin as new string
const cleanedString = string const cleanedString = string