The Code
The code is structured in four function
getUserInput()
This function serves as the controller or entry point function. It is responsible for retreiving the user input from the web page. It also creates variables from the return functions of the other three functions. It also passes all the parameters to the other three functions.
regularExpression()
This function is responsible for taking the user input passed by the first function and (via a regular expression) replaces (via 'replace method') all non alphabet characters with nothing, essentially deleting it. It then forces all the characters remaining to become lowercase. It then returns the 'trimmed' string back to the controller function.
reverseTheString()
This function is responsible for taking the string that was 'trimmed' by the regular expression and reversing that string and assigning it to a new variable called 'reverseArray'. The reversed string is then retruned to the controller function.
PalindromeChecker()
This final function is responsible for taking the string processed by the regular expression as well as the reversement of that string and comparing them to each other with an if statement thereby checking to see if its a palindrome. Via an if statement you will receive a red "not a palindrome" message or a green successful message. This function, in addition to displaying the failure and success cards, also displays the reversed version of the original phrase you entered.