Is there a way to call a function stored as a property using bracket notation in JS? : <p>I am building an object that contains properties where the key is a string and the value is a function. I understand that if the key was not a string, I could use dot notation to call this function. For example:</p>

<pre><code>const obj = new Object();
obj.prop1 = function () {return true}

//what I want to emulate
obj.prop1() 
</code></pre>

<p>In this situation I could just call obj.prop1() to run the function. However, I am adding properties to this object dynamically, and thus need to pass a string when creating properties. Example below: </p>

<pre><code>obj['prop1'] = function() {return true}

//Unfortunately I cannot call the function stored in prop1 using the example below
obj['prop1']() 
</code></pre>

<p>How can I call the function using bracket notation?</p>
