ОмаЭль,
так ?
function test(a) {
for (a = ("" + a).split(""); 1 < a.length;)
if (a.pop() != a.shift()) return !1;
return !0
}
function primer(a) {
for (var b = 0; 10 > b && !test(a); b++) a += +("" + a).split("").reverse().join("");
return [a, test(a)]
};
alert([primer(1),primer(2002),primer(18)])