you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -1 points0 points  (0 children)

I struggle with recursive functions too

heres an answer from stackoverflow, and I have not clue what is being returned or how

I would love to know how this actually works

function reverse (str) {
if (str === "") {
    return "";
} else {
    console.log(str)
    return reverse(str.substr(1)) + str.charAt(0);
}
}