1function reverseString(s){
2 return s.split("").reverse().join("");
3}
4reverseString("Hello");//"olleH"
1String.prototype.reverse=function(){
2 if(this=="") return this;
3 return this.charAt(this.length-1)+reverseString(this.slice(0,this.length-1));
4}