Reverse the String Using JavaScript

Chikul
Posted by Chikul under JavaScript category on | Views : 3527
function reverseStr(str) 
{
if (!str) return; // nothing to change
var rstr = '';
for (i=str.length-1;i>=0;i--)
{
rstr += str.charAt(i);
}
return rstr;
}

Comments or Responses

Login to post response