Reverse String

By Developgram - April 18, 2017

<html>
<body>
  <script>
    var str, rev = "", length, i;
    str = prompt("Enter a String");
    length = str.length;

    for(i = length-1; i >= 0; i--)
    {
      rev += str.charAt(i);
    }
    document.write(rev);
  </script>
</body>
</html>



  • Share:

You Might Also Like

0 comments