Set value of object using a string as the key
<p>Let's say I have a string representing the keys in an object.  Here's an example:</p>

<pre><code>var obj = {
    test: 12,
    high: {
      sky: {
        val: 14
      }
    },
    low: [1, 2, 3]
},
keys = 'high.sky.val';
</code></pre>

<p>So, I want to set the value of <code>obj.high.sky.val</code> (with <code>'high.sky.val'</code> being in a string).</p>

<p>I know how to read the value (though, this may not be the best way):</p>

<pre><code>var keyPieces = keys.split('.'), value = obj;
keyPieces.forEach(function(x){
   value = value[x];
});
console.log(value); // 14
</code></pre>

<p>I can't figure out how to set <code>obj.high.sky.val</code> (without using <code>eval</code>).</p>

<p>How can I set the value of a property in an object, if that key is a string?</p>
