title: Palindrome Checker returns all true, even though it's supposed to return some false (FreeCodeCamp)
body: <p>After 3 days of not being able to complete this challenge, I ended up finding <a href="https://stackoverflow.com/questions/36508962/how-to-check-if-a-string-is-a-palindrome-javascript-closed">another solution</a>.</p>
  <p>Nonetheless, I'm curious as to why my code is always returning true for <strong>all</strong> results instead of false for some results:</p>
  <pre><code>function palindrome(str) {
  
    // CONVERT TO ALL LOWER CASE
    str = str.toLowerCase();
  
    // REMOVE ALL NON-ALPHANUMERIC CHARACTERS (PUNCTUATION, SPACES AND SYMBOLS)
    // Loop through string and push each character in an array
    let strArr = [];
    for (let i = 0; i &lt; str.length; i++) {
      strArr.push(str[i])
      // Remove non-alphanumeric characters
      if (str[i] === /[^0-9a-z]/gi) {
          strArr.splice(str[i], 1);
      }
    }
  
    // CHECK IF STRING IS IDENTICAL FORWARDS AND BACKWARDS
    // Create reverse string
    let strArrRev = strArr;
    strArrRev = strArrRev.reverse();
    if (strArr === strArrRev) {
      return true;
    } else {
      return false;
    }
  }
  
  console.log(palindrome(&quot;eye&quot;));
  console.log(palindrome(&quot;_eye&quot;));
  console.log(palindrome(&quot;race car&quot;));
  console.log(palindrome(&quot;not a palindrome&quot;));
  console.log(palindrome(&quot;A man, a plan, a canal. Panama&quot;));
  console.log(palindrome(&quot;never odd or even&quot;));
  console.log(palindrome(&quot;nope&quot;));
  console.log(palindrome(&quot;almostomla&quot;));
  console.log(palindrome(&quot;My age is 0, 0 si ega ym.&quot;));
  console.log(palindrome(&quot;1 eye for of 1 eye.&quot;));
  console.log(palindrome(&quot;0_0 (: /-\ :) 0-0&quot;));
  console.log(palindrome(&quot;five|\_/|four&quot;));
  </code></pre>