code to determine whether a number is a palindrome code example
Example 1: check if palindrome
function isPalindrome(str) {
str = str.toLowerCase();
return str === str.split("").reverse().join("");
}
Example 2: Palindrome Checker
const palindrome = str = {
str = str.replace(/[\W+|_]/g, '').toLowerCase()
const str1 = str.split('').reverse().join('')
return str1 === str
}
palindrome("My age is 0, 0 si ega ym.");