/**
* @param {number} x
* @return {boolean}
*/
function isPalindrome(x) {
if (x < 0) return false;
if (x < 10) return true;
let str = '';
for (let i = x.toString().length - 1; i >= 0; i--) {
str += x.toString()[i];
}
return str === x.toString()
};
const num = -121;
isPalindrome(num)
// console.log(, 'result')