I'm not really familiar with JavaScript, but uh... it seems to me you're using a string where you should be using an int.
pal1.charAt is going to return a character. Adding the character value (If the character is '9', the character value is 57) to the other character values will give you some random number. (I don't know why you'd want to have this line in your program)
Anyway, if pal2 is a string, and you're trying to make it equal to an integer, it's not going to work (at least in JavaScript, I think. There might be some weird toString stuff going on, but, I dunno.).
It's like saying
String1 = 45
I don't think it'll work. Try wrapping it in String( ). i.e. pal2=String(pal1.charAt(5)+pal1.charAt(4)+pal1.cha rAt(3)+ pal1.charAt(2)+pal1.charAt(1)+pal1.charAt(0))
|