function pallindromeNumber(num){ let rem, final=0, temp = num; while(num > 0){ rem = num % 10; num = parseInt(num/10); final = final * 10 + rem; } if(final === temp) return true; return false; } console.log(pallindromeNumber(12321));
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter