Checks whether text reads the same forwards and backwards, ignoring
case, spaces, and punctuation.
Composes clear (lowercases, strips punctuation) and
reverse internally; reversal is grapheme-cluster aware, so
emoji and combining-mark sequences are handled correctly.
Parameters
text: string
Text to check.
Returns boolean
true if text is a palindrome under those rules, false otherwise.
Example
isPalindrome('A man a plan a canal Panama'); // true isPalindrome('racecar'); // true isPalindrome('hello world'); // false
Checks whether text reads the same forwards and backwards, ignoring case, spaces, and punctuation.
Composes clear (lowercases, strips punctuation) and reverse internally; reversal is grapheme-cluster aware, so emoji and combining-mark sequences are handled correctly.