JSFiddle - React, Tailwind, and code Playground

by Alexander

HTML

<div></div>

JavaScript

document.querySelector('div').innerHTML = reverseString("hello");

//function reverseString(str) { return str.split("").reverse().join("") }

function reverseString(str) { return (str === '') ? '' : reverseString(str.substr(1)) + str.charAt(0) }