let num = 12321; let str = num.toString(); let result = true; for (let i = 0; i < Math.trunc(str.length / 2); i++) { if (str[i] != str[str.length - i - 1]) result = false; } alert(result);