function palindrome(str) {
str = str.toLowerCase();
str = str.replace(/[^a-z0-9]+/g, '');
var reverse = str.split('').reverse().join("");
return str == reverse;
}
I mean it works but when we were in school, we were told that for this to be considered legit, there shouldn’t be any occurrence of the word > reverse in the whole function