Determine whether the input string is a palindrome or not
const isPalindrome = (str) => {
if (
str.length === 0 ||
str === undefined ||
str === null ||
typeof str !== 'string'
)
return false;
let newCleanedString = stringClean(str);
let leftPointer = 0;
let rightPointer = str.length - 1;
while (leftPointer < rightPointer) {
if (newCleanedString[leftPointer] === newCleanedString[