title: Edit Eval()'d JSON - Javascript
body: <p>Take the following object. I'm trying to pass a string path to "gold", eval() it and then increment it like so:</p>
  
  <pre><code>var inv = {
      "gold" : 10
  }
  
  eval('inv.gold')++;
  </code></pre>
  
  <p>It's not working however. I've tried using JSON.parse as well but it didn't work (whether it was me writing it wrong or something else I don't know).</p>
  
  <p>What is the correct way to do this?</p>