Create a JSON field according to the value of a variable : <p>Supposing we have JSON data who came as :</p>

<pre><code>msg = {
    fieldName: fieldA
};

msg = {
    fieldName: fieldB
};
</code></pre>

<p>I can receive multiple of this message, but everytime i have a different field, i want it to add in the 'data' json object, as i can access by using this :</p>

<pre><code>data.fieldA
data.fieldB
</code></pre>

<p>By which way can i perform this ?</p>
