title: checking browser local storage for item in array
body: <p>I have created a login button that is supposed to take the Array stored in the browser local storage, read each item and check if the username and password written in the input boxes are inside the Array).</p>
  <p>The Array is successfuly taken from storage, but when the code is supposed to read it and compare the items to the input for some reason it always says the input isn't in the Array. How could I fix that? Code follows:</p>
  <pre><code>const loginForm = document.getElementById(&quot;loginForm&quot;);
  const loginButton = document.getElementById(&quot;loginButton&quot;);
  const loginError = document.getElementById(&quot;loginError&quot;);
  
  const registerForm = document.getElementById(&quot;registerForm&quot;);
  const registerButton = document.getElementById( &quot;registerButton&quot;);
  const registerError = document.getElementById(&quot;registerError&quot;);
  
  /*HERE IS THE PROBLEMATIC LOGIN BUTTON*/  
  loginButton.addEventListener(&quot;click&quot;, (e)=&gt; {
      e.preventDefault();
  
      const username = loginForm.username.value;
      const password = loginForm.password.value;
  
      const user ={ username, password};
  
      let checkUser =[];
      checkUser = JSON.parse(localStorage.getItem(&quot;registred users&quot;));
  
      let checkUserInfo = checkUser.includes(user, 0);
  
      if( checkUserInfo == true){
          alert(&quot;Login sucessful!&quot;);
          location.reload();
      } else {
          loginError.style.opacity = 2;
  
      }
  })
  
  registerButton.addEventListener(&quot;click&quot;, (e)=&gt; {
      e.preventDefault();
  
      const registerUsername = registerForm.registerUsername.value;
      const registerPassword = registerForm.registerPassword.value;
      const confirmPassword = registerForm.confirmPassword.value;
      const registerEmail = registerForm.registerEmail.value;
  
      const userData = {registerUsername, registerPassword};
      let registredUserData = [];
     
  
      if(registerPassword.length &gt; 8 &amp;&amp; registerPassword.match(/[a-z]+/) &amp;&amp; registerPassword.match(/[A-Z]+/) &amp;&amp; registerPassword.match(/[0-9]+/) &amp;&amp;  registerPassword.match(/[$@#&amp;!]+/) &amp;&amp; registerPassword === confirmPassword &amp;&amp; registerEmail.match(/[@/]+/ ) ){      
  
          registredUserData = JSON.parse(localStorage.getItem(&quot;registred users&quot;));
          registredUserData.push(userData);
          localStorage.setItem(&quot;registred users&quot;,JSON.stringify(registredUserData));
              
  
          location.reload();
      } else {
          registerError.style.opacity = 2;
  
      }
  })
  </code></pre>