title: In Javascript is it possible to create an object with dynamic (undetermined) properties/members?
body: <p>I try to achieve this in Javascript:</p>
  
  <pre><code>var a = new MyObj();
  console.log(a.Foo()); // Print Foo
  console.log(a["Bar"]()); // Print Bar
  </code></pre>
  
  <p>Basically, I don't know beforehand the property/member name that is needed, but depends on the calling I return it, a bit similar to C# <code>ExpandoObject</code> (dynamic).</p>
  
  <p>Is it possible to make such an object in Javascript?</p>
  
  <p>Note: I know it is possible to <em>add</em> the properties, however, in my case I do not know beforehand which are needed to add.</p>
  
  <pre><code>a.Foo = () =&gt; { return "Foo"; }
  </code></pre>
  
  <p>This is not possible because I don't know <code>Foo</code> will be needed.</p>