function reverse(str) {
if (str === "")
return "";
else
return reverse(str.substr(1)) + str.charAt(0);
}
reverse("hello");
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter