Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Reverse String in Javascript

function reverseString(str) {
    var newString = "";
    for (var i = str.length - 1; i >= 0; i--) {
        newString += str[i];
    }
    return newString;
}
console.log(reverseString('welcome'));
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #Reverse #String #Javascript
ADD COMMENT
Topic
Name
2+2 =