title: javascript username and password
body: <p>Today I started learning javscript but when I tried to create an extremely basic login feature it wouldn't work.
  so I'm trying to use an array to store the usernames and another for the passwords but when I enter them it comes up with wrong username or pass help.</p>
  
  <p>here is the code</p>
  
  <pre><code>var usernames=new Array(); 
   usernames[0]="user";       
   usernames[1]="sam";
   usernames[2]="bob";
   var passwords=new Array(); 
   passwords[0]="pass";       
   passwords[1]="pass1";
   passwords[2]="pass19";
  
  var neworold=prompt("sign in or create account"); 
  
  
  if (neworold &gt; 8 ){
  var createu=prompt("Please enter your desired username");
    var createp=prompt("Please enter your desired password");
  
   } else {
   var username=prompt("Please enter your username");
   var password=prompt("Please enter your password");}
  
  if (username == usernames) {
   if (password == passwords) {
   alert("");
  }
  } else {
  alert("wrong username or pass");
  }
  </code></pre>