var getString = prompt("", "HarryP");
function reverseStr(str) {
    var splitString = str.split("");  
    var reverseArray = splitString.reverse(); 
    var joinArray = reverseArray.join("");     
    return joinArray;
}
 
console.log(reverseStr("getString"));