Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript palindrome

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));
Source by www.abdulbaasit.me #
 
PREVIOUS NEXT
Tagged: #javascript #palindrome
ADD COMMENT
Topic
Name
1+7 =