Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to check the number is palindrome or not

function isPalindrome(num) {
   const temp = num.toString().split('').reverse().join('') * 1;
   return (result = num === parseInt(temp) ? true : false);
}

console.log(isPalindrome(121));
console.log(isPalindrome(320));
 
PREVIOUS NEXT
Tagged: #check #number #palindrome
ADD COMMENT
Topic
Name
7+4 =