In this tutorial, you will learn to write a JavaScript program that reverses a string.
Reverse string without builtin function
function reverseString(str)
{
var reverse='';
for(i=str.length-1;i>=0;i--)
{
reverse+=str[i];
}
return reverse;
}
Output:
In this tutorial, you will learn to write a JavaScript program that reverses a string.
Reverse string without builtin function
function reverseString(str)
{
var reverse='';
for(i=str.length-1;i>=0;i--)
{
reverse+=str[i];
}
return reverse;
}
Output: