function palindrome(str) {
    let arr = str.toLowerCase().match(/[a-z0-9]/g);
    let hafLen = Math.ceil(arr.length / 2);

    let j = arr.length - 1;
    for (let i = 0; i < hafLen; i++) {
        // console.log(arr[i], arr[j]);
        if (arr[i] !== arr[j]) {
            console.log(false, str);
            return false;
        }
        j--;
    }

    console.log(true, str);
    return true;
}
/** 
    Palindrome Checker 

    Return true if the given string is a palindrome. Otherwise, return false.

    A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.

    Note: You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything into the same case (lower or upper case) in order to check for palindromes.

    We'll pass strings with varying formats, such as racecar, RaceCar, and race CAR among others.

    We'll also pass strings with special symbols, such as 2A3*3a2, 2A3 3a2, and 2_A3*3#A2.
    
*/
Palindrome Checker
Return true if the given string is a palindrome. Otherwise, return false.

A palindrome is a word or sentence that's spelled the same way both forward and backward, ignoring punctuation, case, and spacing.

You'll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything into the same case (lower or upper case) in order to check for palindromes.

We'll pass strings with varying formats, such as racecar, RaceCar, and race CAR among others.

We'll also pass strings with special symbols, such as 2A3*3a2, 2A3 3a2, and 2_A3*3#A2.
Palindrome Checker Return true if the given string is a palindrome . Otherwise return false . A palindrome is a word or sentence that ' s spelled the same way both forward and backward ignoring punctuation case and spacing . You ' ll need to remove all non - alphanumeric characters ( punctuation spaces and symbols ) and turn everything into the same case ( lower or upper case ) in order to check for palindromes . We ' ll pass strings with varying formats such as racecar RaceCar and race CAR among others . We ' ll also pass strings with special symbols such as 2A3 * 3a2 2A3 3a2 and 2_A3 * 3#A2 .
function palindrome(str) {
    let arr = str.toLowerCase().match(/[a-z0-9]/g);
    let hafLen = Math.ceil(arr.length / 2);
    let j = arr.length - 1;
    for (let i = 0; i < hafLen; i++) {
        if (arr[i] !== arr[j]) {
            console.log(false, str);
            return false;
        }
        j--;
    }
    console.log(true, str);
    return true;
}
function palindrome ( str ) { let arr = str . toLowerCase ( ) . match ( / [a-z0-9] / g ) ; let hafLen = Math . ceil ( arr . length / 2 ) ; let j = arr . length - 1 ; for ( let i = 0 ; i < hafLen ; i ++ ) { if ( arr [ i ] !== arr [ j ] ) { console . log ( false , str ) ; return false ; } j -- ; } console . log ( true , str ) ; return true ; }
Palindrome Checker
Return true if the given string is a palindrome.
Palindrome Checker Return true if the given string is a palindrome .
// console.log(arr[i], arr[j]);