Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Recursive reverse string

function reverse (str) {
    if (str === "") {
        return "";
    } else {
        return reverse(str.substr(1)) + str.charAt(0);
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Recursive #reverse #string
ADD COMMENT
Topic
Name
2+3 =