Would This palindrome function be considered correct?

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

If it’s for your school and your school told you not to use reverse(), then you need to refactor it to avoid that. Otherwise, it’s correct.