Python

#recursive

def reverse_str(txt):
    if len(txt) == 1:
        return txt[0]

    return reverse_str(txt[1:]) + txt[0]

assert reverse_str('abcxyz') == 'zyxcba'

Javascript

#recursive

const assert = require('assert');

function reverseStr(txt) {
	if (txt.length == 1) {
		return txt[0];		
	}


	return reverseStr(txt.substr(1)) + txt[0];
}

assert.equal(reverseStr('abcxyz'), 'zyxcba');