title: How do I SET to the Object's properties if I have a path array to the needed property?
body: <pre><code>var obj = {
    people: {
      John: {
        pets:{
          dog:{
            name:"Umbrella",
            age:12
          },
          cat:{
            name:"Kitty",
            age:5
          }
        }
      }
    }
  };
  var path=['people', 'John', 'pets', 'cat', 'name'];
  var newName='Train';
  </code></pre>
  
  <p>How do I SET what the array wants (now it is cat's name) to the object? The array can be changed, so I can not write it by hand. I need a function to do it automatically depending on the array</p>