for(let i=(string.length-1); i>=0; i--){
str2 += string[i];
}
var str = 'chupacabra';
function reverse(str) {
if (str.length === 0) return '';
var
s1 = str[0],
s = str.slice(1, str.length - 1),
s2 = str[str.length - 1]
return s2 + reverse(s) + s1
}
console.log(reverse(str))