Build a Palindrome Checker Project - Build a Palindrome Checker

hello everybody :grinning:
i’m having more or less the same problems.
all the steps pass untill i put the code for the alphanumeric palindrome.
when i paste the code for alphanumeric palindrome

function isPalindrome(str) {
    // Remove non-alphanumeric characters and convert to lowercase
    str = str.replace(/[^0-9a-z]/gi, '').toLowerCase();

    // Compare characters from the start and end of the string
    // and stop if a mismatch is found or the middle of the string is reached.
    for (let i = 0; i < str.length / 2; i++) {
        if (str[i] !== str[str.length - i - 1]) {
            return false;
        }
    }

    return true;
}

// Prompt the user for input
checkButton.addEventListener('click', () => {
    const inputText = inputField.value.trim();

    if (inputField.value === '') {
        resultDiv.textContent = 'enter some text';
        return;
    }

    // Output the result
    if (isPalindrome(inputText)) {
        resultDiv.textContent = `"${inputText}" is a palindrome.`;
    } else {
        resultDiv.textContent = `"${inputText}" it is not a palindrome`;
    }
});

any suggestions?

I have your post into a new thread. It’s best to make your own thread instead of taking over someone else’s.

This doesn’t look like an exact, word for word match of the requested message

thank you
I appreciate

do you think the problem is only the word for word match?
I mean , is the code correct?
why without that last bit of code, all the steps pass the test and dont pass with that piece of code?
that is one of the thinks I
dont understand…

I don’t know if it’s the only problem. I just saw a problem

remove the quotes

remove the quotes and fix the wording

the output needs to be exactly as requested

remove the quotes…?
do you mean the `` quotes?

what is the difference?
i’m not sure I understood whay and when those quotes are necesary or not.
can you explain?

They’re not necessary because you’re already using template literals which serve as a form of quote if you get what i mean

i removed the quotes " ----"
changed some words and passed all the steps.

    // Output the result
    if (isPalindrome(inputText)) {
        resultDiv.textContent = `${inputText} is a palindrome.`;
    } else {
        resultDiv.textContent = `${inputText} is not a palindrome`;
    }
});

I understand what you mean.

thank you.