title: adding functions to JSON without using eval
body: <p>Is it possible to make something like this without using eval?</p>
  
  <pre><code>foo1 = {"x": 4};
  foo2 = {"x": "someFunc(foo1.x)"};
  
  someFunc(var1)
  {
      return (var1 + 1);
  }
  
  alert(foo1.x); // 4
  alert(foo2.x); // 5 (hopefully)
  </code></pre>
  
  <p>Actually this is two problems. The first is to get a function to execute and the second is to do so without the parentheses, because in a loop I don't know if it's foo2.x or foo2.x().</p>
  
  <p>The best thing I can think of is to search the JSON objects for keywords representing functions and use a switch list to execute them and replace the keywords with the value.</p>
  
  <p>The disadvantage is that I need to update the JSON object every time something changes.</p>