javascript recursive version (no reverse junk)
function p(s){l=s.length;return l<2||(s[0]==s[l-1]&&p(s.substr(1,l-2)))}
(72 chars)
or implement reverse inside:
p=function(s,y){return y?(s==p(s)):s[1]?(p(s.substr(1))+s[0]):s[0]}
p("hannah",1);
(67 chars)
or, using no built in functions at all...
p=function(s,y,i){
return i?s[i]?s[i]+p(s,0,i+1):'':y?(s==p(s)):s[1]?(p(p(s,0,1))+s[0]):s[0]
}
p("hannah",1);
(92 chars)
shortest I could come up with: (iterative)
function p(s,l){for(c in s){if(s[c]!=s[l-1-c])s=0}return s}
p("hannah",6);// (is this cheating?)
(59 chars)
looking forward to seeing you do it better in javascript!
(preferably without using any built in functions, especially reverse)
(not really very impressed by the 'return s==s.reverse()' type answers)