Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

palindrome in javascript

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: #palindrome #javascript
ADD COMMENT
Topic
Name
9+6 =