[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/anasmak04/Problem-solving-with-JavaScript/master/problem-22.js [Back]  [Original]

// 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));

Web Proxy Viewer  |  New URL  |  Original Page