Function to check if the number N is palindrome
function ispalindrome ( n ) { let temp = n . toString ( ) ; let l = temp . length ; for ( let i = 0 ; i < parseInt ( l / 2 , 10 ) ; i ++ ) { if ( temp [ i ] != temp [ l - i - 1 ] ) return false ; } return true ; }