The first method
var str = "abcdef";
console.log( str.split("").reverse().join("") );
Second method:
var str="abcdef"
var i=str.length;
i=i- 1;
for (var x = i; x >=0; x--)
{
document.write(str.charAt(x));
}
Third method:
<script> <br>function reverse(str) <br>{ <br> if(str.length == 0)return null; <br> var i = str. length; <br> var dstr = ""; <br> while(--i >= 0) <br> { <br> dstr = str.charAt(i); <br> } <br> return dstr; <br>} <br>var str = "abcdef"; <br>str = reverse(str); <br>document.write(str); <br></script>