function isPalindrome( x ) { // write code here if(x<0){ return false; } let y = 0; while(x>y){ y = y * 10 + x%10; x = parseInt(x/10); } return x == y || x == parseInt(y/10); } module.exports = { isPalindrome : isPalindrome };