title: FETCH API returning [object Object]
body: <p>I am using FETCH API to get a value stored in a json file. That value has to go into a variable.</p>
  
  <p>The problem is - the variable ends up holding [object Object] as value. </p>
  
  <pre><code>var title = fetch('URL/out.json', {mode: 'cors'});
  </code></pre>
  
  <p>In the htaccess of the server hosting the json file, there is the line</p>
  
  <pre><code>  Header set Access-Control-Allow-Origin "*"
  </code></pre>
  
  <p>The json is as follows</p>
  
  <pre><code> {
     lollol
  }
  </code></pre>
  
  <p>I think the json might be the culprit.</p>
  
  <p>I cannot find the reason for [object Object] to be the variable value.</p>
  
  <p>Can I use Fetch to get a hosted text file? I tried - couldn't get it work. - just thinking of an alternative.</p>