const reverse = (str) => {
let res = '';
const index = str.length-1;
if (index === 0 || index === 1) return str;
else {
res += iter(str, index)
}
};
const iter = (str, index) => {
if (index !== 0) return iter(str, index-1);
}
const reverse = str => str.length < 2 ? str : reverse(str.slice(1)) + str[0];
const reverse = ([ c, ...str ]) => c ? reverse(str) + c : '';