TypeScript Check Palindrome
function checkPalindrome(inputString: string): boolean {
return inputString.split("").reverse().join("") === inputString;
}
This compares the string with its reverse. If they match, it is a palindrome.
function checkPalindrome(inputString: string): boolean {
return inputString.split("").reverse().join("") === inputString;
}
This compares the string with its reverse. If they match, it is a palindrome.