title: How do I read into JavaScript from JSON file?
body: <p>How do I read information from a JSON file into a JavaScript so that I can display that value into a HTML page?</p>
  <p>In the if statement and the item.innerHTML line are both not picking up the data from the JSON file.</p>
  <p>I have the animal's value reading in from the JSON file and then the if statement prints the information a HTML file</p>
  <pre><code>let animals = JSON.parse(animals);
  
  for(let i = 0; i &lt; animals.length; i++){
        if(animals.dogs[i].dogId === dog[i]) {
            item.innerHTML += &quot;&lt;li&gt;&quot; + animals.dogs[i].dogName + &quot;&lt;/li&gt;&quot;;
          }
  }
  </code></pre>
  <p>The data in the JSON file looks like this:</p>
  <pre><code>{
      &quot;animals&quot;: {
          &quot;dogs&quot;: [
              {
                  &quot;dogId&quot;: &quot;DW-001&quot;,
                  &quot;dogName&quot;: &quot;Fido&quot;,
                  &quot;dogType&quot;: &quot;Poodle&quot;,
                  &quot;dogType&quot;: &quot;Small&quot;,
                  &quot;description&quot;: &quot;Excellant lap dog, doesn't shed.&quot;,
                  &quot;pricePerHour&quot;: &quot;3.0&quot;
              }
       ]
      }
  }
  </code></pre>