Reverse String
function reverseString(str) {
return str.split('').reverse().join('');
}
console.log(reverseString("master of puppets"));
function reverseStringRecursive(str) {
if (str === "") {
return "";
} else {
return reverseStringRecursive(str.substr(1)) + str.charAt(0);
}
}
console.log(reverseStringRecursive("master of puppets"));INFO