Created
July 5, 2017 13:08
-
-
Save tomrockdsouza/b7f84b973a362a2df32cb6590cb96d77 to your computer and use it in GitHub Desktop.
Small program to find if a number is a palindrome string in it's decimal form.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function palinum(a){ | |
b=a; | |
c=0; | |
while(b!=0){ | |
c*=10; | |
c+=b%10; | |
b/=10; | |
b=Math.floor(b); | |
} | |
console.log(c==a); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment