title: Vanilla Javascript, how to read local JSON file
body: <p>I am new to javascript and I am trying to read a JSON file using javascript, but I do not know how to access data from the promise result. I have my data in a .json file call Data.json and I am using fetch inside in a promise to load the JSON file and return the result. How can I get the data from the promise result?</p>
  <p><strong>Data in JSON file</strong></p>
  <pre><code>{
   &quot;data&quot;: {
     &quot;reviewer&quot;: [
    {
      &quot;id&quot;: 1,
      &quot;name&quot;: &quot;susan smith&quot;,
      &quot;job&quot;: &quot;web developer&quot;,
      &quot;text&quot;: &quot;I'm baby meggings twee health goth +1. Bicycle rights tumeric chartreuse before they sold out chambray pop-up. Shaman humblebrag pickled coloring book salvia hoodie, cold-pressed four dollar toast everyday carry&quot;
    },
    {
      &quot;id&quot;: 2,
      &quot;name&quot;: &quot;anna johnson&quot;,
      &quot;job&quot;: &quot;web designer&quot;,
      &quot;text&quot;: &quot;Helvetica artisan kinfolk thundercats lumbersexual blue bottle. Disrupt glossier gastropub deep v vice franzen hell of brooklyn twee enamel pin fashion axe.photo booth jean shorts artisan narwhal.&quot;
    },
    {
      &quot;id&quot;: 3,
      &quot;name&quot;: &quot;peter jones&quot;,
      &quot;job&quot;: &quot;intern&quot;,
      &quot;text&quot;: &quot;Sriracha literally flexitarian irony, vape marfa unicorn. Glossier tattooed 8-bit, fixie waistcoat offal activated charcoal slow-carb marfa hell of pabst raclette post-ironic jianbing swag.&quot;
    },
    {
      &quot;id&quot;: 4,
      &quot;name&quot;: &quot;bill anderson&quot;,
      &quot;job&quot;: &quot;the boss&quot;,
      &quot;text&quot;: &quot;Edison bulb put a bird on it humblebrag, marfa pok pok heirloom fashion axe cray stumptown venmo actually seitan. VHS farm-to-table schlitz, edison bulb pop-up 3 wolf moon tote bag street art shabby chic. &quot;
    }
  ]
  }}
  </code></pre>
  <p><strong>JavaScript Code</strong></p>
  <pre><code>const data = new Promise((resolve, reject) =&gt; {
  fetch('./Data.json')
      .then(respond =&gt; {
          resolve(respond.json())
      }).catch(err =&gt; {
          reject(err)
   })
  })
  
  console.log(data)
  </code></pre>
  <p>When I run the code, I got this in the console.</p>
  <p><a href="https://i.stack.imgur.com/MgHBy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MgHBy.png" alt="enter image description here" /></a></p>