title: Add a new property inside object without directly adding it?
body: <p>I have this code:</p>
  
  <pre><code>var a = {
   b: "Hello",
   c: "Foo",
   d: "Bar"
  };
  
  if(a["b"]) {
    // this code will add a new property inside the object a
  }
  </code></pre>
  
  <p>How can I add a new property without directly adding it inside the <code>a</code> object? I mean, adding a new property inside it after the object's being created? Something like this.</p>
  
  <pre><code>function addNewPropertyInsideObject(obj,propname,propvalue) {
   // some code here
  }
  
  var a = {
   b: "Hello",
   c: "Foo",
   d: "Bar"
  };
  
  addNewPropertyInsideObject(a, e, "Baz"); // this code will add a new property with the name "e" &amp; value "Baz" inside the object "a"
  </code></pre>