{"ScriptPreparationCode":"function checkPalindrome(input){\r\n return isPalindrome(input.replace(/ /g,\u0027\u0027).toLowerCase());\r\n}\r\n\r\nfunction isPalindrome(input) {\r\n if (input.length \u003C= 1) {\r\n return true;\r\n } else {\r\n return (input[0] === input[input.length-1]) \u0026\u0026\r\n isPalindrome(input.substring(1,input.length-1));\r\n }\r\n}","TestCases":[{"Name":"detects an empty string as a palindrome","Code":"checkPalindrome(\u0027\u0027);","IsDeferred":false},{"Name":"detects a single character as a palindrome","Code":"checkPalindrome(\u0027a\u0027);","IsDeferred":false},{"Name":"detects palindromic word","Code":"checkPalindrome(\u0027hannah\u0027);","IsDeferred":false},{"Name":"detects non-palindromic word","Code":"checkPalindrome(\u0027spanner\u0027);","IsDeferred":false},{"Name":"detects palindromic sentence with capitalisation","Code":"checkPalindrome(\u0027Mr owl ate my metal worm\u0027);","IsDeferred":false},{"Name":"detects palindromic sentence","Code":"checkPalindrome(\u0027Never Odd Or Even\u0027);","IsDeferred":false},{"Name":"detects non-palindromic sentence","Code":"checkPalindrome(\u0027Never Even Or Odd\u0027);","IsDeferred":false}]}