title: Parse JSON in R using V8 $eval?
body: <p>If we open chrome developer console (command + option + j), go the javascript console, and enter</p>
  <pre class="lang-js prettyprint-override"><code>JSON.parse('{ &quot;name&quot;:&quot;John&quot;}');
  </code></pre>
  <p>which returns <code>{name: &quot;John&quot;}</code></p>
  <p>but when we run the same javascript in R using V8 (using the example <a href="https://stackoverflow.com/questions/37515062/how-to-parse-javascript-data-list-with-r">here</a>), it returns a different result</p>
  <pre><code>library(V8)
  ctx &lt;- v8()
  ctx$eval(&quot;JSON.parse('{\&quot;name\&quot;:\&quot;John\&quot;}');&quot;)
  
  # &quot;[object Object]&quot;
  </code></pre>
  <p>How can we get <code>V8::eval()</code> to return the correct result?</p>
  <h3>Note</h3>
  <ul>
  <li>The <a href="https://cran.r-project.org/web/packages/V8/V8.pdf" rel="nofollow noreferrer">documentation</a> may hold some clues (I've tried a few things from there but nothing successfully)</li>
  </ul>