1 | function R(x){z=x.length-1;y='';for(i=0;i<=z;i++){y+=x.charAt(z-i);}return y;} |
1 | function R(x){z=x.length;y='';for(i=0;i<=z;y+=x.charAt(z-i++));return y} |
1 | function R(x){z=x.length-1;y='';for(i=0;i<=z;y+=x[z-i++]);return y} |
1 | function R(x){y='';for(i=x.length-1;i>=0;y+=x[i--]);return y} |
1 | function R(x){y='';for(i=x.length-1;i>=0;y+=x[i--]);return y} |
1 | function R(x){for(z=x.length,y='',i=1;i<=z;y+=x[z-i++]);return y} |
1 2 3 | function R(x){y='';for(i=x.length;i>=1;y+=x[--i]);return y} |
1 | function R(x){return x.split('').reverse().join('')} |
1 2 3 4 | //With recursion, of course function R(x){return x&&R(x.slice(1))+x[0]} |