Palindrome Checker

Hi, I’ve just completed the Palindrome Checker activity, however afterwards when I checked the solutions I noticed the recommended code. Would my solution be considered bad code?

function palindrome(str) {
  // Good luck!
  var removeSpecs = str.replace(/([^a-z0-9]+)/gi, '').toLowerCase();
  var strArray = removeSpecs.split("");
  var stripped = strArray.join("");
  var reversed = strArray.reverse().join("");
  
  
  if (stripped === reversed){
    return true;
  } else {
    return false;
  }
}


palindrome("Eyes");

Thanks for your feedback. I need to accept that there is more than one way to solve a problem and any further efficiency will hopefully come with time.