Ad

reverse the string passed as an arg and return the result

function revstr(str) {
  i = str.length; newstr = "";
  while (i > 0) {
    newstr += str[i - 1]; i--;
  }
  return newstr;
}