title: How to fix Invalid destructuring assignment target?
body: <p>What I can do in order to fix my problem? I'm a new newbie in javascript and any recomendations or advices could be helpful to me.</p>
  
  <pre><code>var user = {
      username: "Andrey",
      password: "JavaScript"
      },
      {
      username: "Max",
      password: "12345"
      },
      {
      username: "Pasha",
      password: "OWL"
      };
  
  var database = [user];
  
  var newsfeed = [
      {
          username: "Bobby",
          timeline: "DOOOOOOG!",
      },
      {
          username: "Max",
          timeline: "CAAAAT!",
      },
      {
          username: "Lida",
          timeline: "John Ceeeenaaaa!",
      }
  ];
  
  var userNamePrompt = prompt("Your Username?");
  var passwordPrompt = prompt("Your password?");
  
  function isUserValid(Name, Pass){
      for (var i=0; i&lt;database.length; i++){
          if (database[i].username === Name &amp;&amp;
              database[i].password === Pass) {
              return true;
          }
      }
      return false;   
  }
  
  function SignIn (Name, Pass){
      if (isUserValid(Name, Pass)) {
          console.log(newsfeed);
      }
      else {
          alert("Sorry smt went wrong!");
      }
  }
  
  SignIn (userNamePrompt, passwordPrompt);
  </code></pre>
  
  <p>If the code is working correctly, i should get back an array with a newsfeed, but instead im getting:
  Invalid destructuring assignment target</p>