This compares the i-th character from the start with the i-th character from the end.
if (str[i] !== str[len - 1 - i])
str[i] from the front
str[i]
str[len - 1 - i] from the back
str[len - 1 - i]
If they don’t match, the string is not a palindrome.