title: Check if value exists in JSON Object
body: <p>I am learning NodeJS . I am using a JSON Object to check if a user is present.</p>
  
  <p>This is my JSON (users.json):</p>
  
  <pre><code>{
      "users": [{
          "fname": "Robert",
          "lname": "Downey Jr.",
          "password": "ironman"
      }, {
          "fname": "Chris",
          "lname": "Evans",
          "password": "cap"
      }, {
          "fname": "Chris",
          "lname": "Hemsworth",
          "password": "thor"
      }, {
          "fname": "Jeremy",
          "lname": "Renner",
          "password": "hawk"
      }]
  }
  </code></pre>
  
  <p>Now I want to pass the fname value of one entry and see if it exists in the JSON Object.</p>
  
  <p>This is what I'm doing :</p>
  
  <pre><code>var file = JSON.parse(fs.readFileSync('users.json', 'utf8'));
  for (eachUser in file.users) {
              console.log(eachUser.fname);
          }
  </code></pre>
  
  <p>But I do not get the fname values but just <code>undefined</code> . I don't know what I am doing wrong. </p>
  
  <p>Also is there a way to find if the value exists without having to iterate over the JSON Object ?</p>