Dynamically add object in javascript array
<p>I have json:</p>

<pre><code>var obj = '{"Form":[],"Provider":[]}';
</code></pre>

<p>I push the data with variable value to make dynamic objects:</p>

<pre><code>var pName = 'Tester';
var data = {
    pName :["testing"]
};
console.log(obj['Provider'].push(data));
</code></pre>

<p>But that adds pName as variable name but not variable value that is <strong>Tester</strong>, i tried with +pName+ that also not works.</p>

<p>Returns:</p>

<pre><code>{"Form":[],"Provider":[{"pName":["Testing"]}]}
</code></pre>

<p>Any help would be appreciated.</p>