title: node.js set property from string property name
body: <p>I was trying to create a function able to set a certain value of an object, having the "path" of the property:</p>
  
  <pre><code>reflectionSet = function(obj, propString, value) {
      var current = obj;
      var splitted = propString.split('.');
      splitted.forEach(function(k) {
          current = current[k];
      })
      current = value;
  }
  var test = {
      a: {
          s: 'asd',
          g: 'asasdasdd'
      }
  };
  
  reflectionSet(test, 'a.g', "otherValue");
  </code></pre>
  
  <p>and it should become: </p>
  
  <pre><code>{
      a: {
          s: 'asd',
          g: 'otherValue'
      }
  }
  </code></pre>
  
  <p>Unfortunately this doesn't work at all.. Thanks</p>