Answer and Explanation:
var gettext= prompt("please enter text");
function strtok(gettext){
var splitString = gettext.split("");
if(splitString.length<=80){
var reverseArray = splitString.reverse();
var joinArray = reverseArray.join("");
return joinArray;}
else{
Alert("too many characters");
}
}
/* we first ask for user input using the prompt function. We save this in a variable gettext which we pass to the strtok function. This function first splits the text and makes it an array so we are able to count how many characters the user enters and set an if..else condition to handle characters that may be more than 80. The reverse and join functions are then used respectively to reverse and return the string.*/