title: Downloading local json executing twice
body: <p>I am trying to download a locally generated json with this code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function downloadJson(data, name) {
      let dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(data));
      var downloadAnchorNode = document.createElement('a');
      downloadAnchorNode.setAttribute('href', dataStr);
      downloadAnchorNode.setAttribute('download', name);
      document.body.appendChild(downloadAnchorNode);
      downloadAnchorNode.click();
      downloadAnchorNode.remove();
  }
  
  downloadJson({foo: "bar"}, "example.json");</code></pre>
  </div>
  </div>
  </p>
  
  <p>But for a reason it is downloading 2 copies of the same json. Does anybody knows what is happening?</p>