Using a for Loop to Reverse a String
<HTML> <BODY> <H1> <SCRIPT> var newString = ""; var theString = "This is a test"; var counter = theString.length; for (counter ;counter > 0 ;counter -- ) { newString += theString.substring(counter-1, counter); } document.write(theString + " reversed is " + newString + "!"); </SCRIPT> </H1> </BODY> </HTML>