title: How to read an external local JSON file in JavaScript?
body: <p>I have saved a JSON file in my local system and created a JavaScript file in order to read the JSON file and print data out. Here is the JSON file:</p>
  <pre><code>{&quot;resource&quot;:&quot;A&quot;,&quot;literals&quot;:[&quot;B&quot;,&quot;C&quot;,&quot;D&quot;]}
  </code></pre>
  <p>Let’s say this is the path of the JSON file: <code>/Users/Documents/workspace/test.json</code>.</p>
  <p>Could anyone please help me write a simple piece of code to read the JSON file and print the data in JavaScript?</p>