title: How to access the value of the key inside the Jsonfile with for loop
body: <p>I am trying to reach username in this for loop. I want to compare username in the request with username in the file. In the for loop i wrote below, I reach the key  for <strong><em>""(let user in users)"</em></strong> this  <strong><em>"1580996730372"</em></strong> key. What do I need to do to access the username inside the file. i have tried Object.values() and Object.keys() but maybe i am doing w</p>
  
  <h2>FOR LOOP</h2>
  
  <pre><code>
      let users = JSON.parse(data);
  
      for (let user in users) {
         if (JSON.stringify(users[user]) === JSON.stringify(req.body)) {
           res.status(200).send({ [user]: users[user] });
         return;
      }
  
  </code></pre>
  
  <h2>JSON DATA</h2>
  
  <pre><code>    {
      "1580996730372": {
          "id": "f08dbc40-48e6-11ea-bbe9-c762eb24fe1f",
          "username": "D",
          "password": "kkk333"
      },
      "1580996733810": {
          "id": "f29a5520-48e6-11ea-b91e-fb39bf5103d1",
          "username": "Dskskk",
          "password": "kkk333"
      },
      "1581009019213": {
          "id": "8d460fd0-4903-11ea-9b24-1bb0f34ace07",
          "username": "Dkdkd",
          "password": "vvvkxkkffkk748484"
      },
      "1581009170013": {
          "id": "e72850d0-4903-11ea-ae92-c3bd48f3469a",
          "username": "Dkdkdjjj",
          "password": "hhjh7666"
      },
      "1581068163542": {
          "id": "420a7760-498d-11ea-b90d-4d96b87b7fc1",
          "username": "İbotest",
          "password": "skskkssk377338"
      }
  }
  </code></pre>