mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 02:05:08 +08:00
fixed some spellings
This commit is contained in:
@ -8,7 +8,7 @@ const checkPalindrome = (str) => {
|
||||
if (str.length === 0) {
|
||||
return 'Empty string'
|
||||
}
|
||||
// Reverse only works with array, thus conevert the string to array, reverse it and convert back to string
|
||||
// Reverse only works with array, thus convert the string to array, reverse it and convert back to string
|
||||
// return as palindrome if the reversed string is equal to the input string
|
||||
const reversed = [...str].reverse().join('')
|
||||
return str === reversed ? 'Palindrome' : 'Not a Palindrome'
|
||||
|
Reference in New Issue
Block a user