Splitting an object into multiple object and pushing them in an array in javascript(Possibly using underscore/lodash)
<p>I want to split an object in an array based on a criteria.
If i get json response like this :-</p>

<pre><code>var obj = { dataSo : [{ key1 : "value1", key2 : "value.1.2", key3 : ["value1.3.1","value.1.3.2"]},
            { key1 : "value1", key2 : "value.2.2", key3 : ["value2.3.1","value2.3.2","value.2.3.3"]},
            { key1 : "value1", key2 : "value.3.2", key3 : ["value.3.3.1"]},
            { key1 : "value1", key2 : "value.4.2", key3 : []}]}
</code></pre>

<p>Then i have to check whether key3 has got more than one value.If it does contain more than one value then i should copy that whole object while keeping the key3 value different and make copies of it and pushed it into array as new object.</p>

<p>For e.g from previous data i should make something like this :-</p>

<pre><code>{ dataSo : [{ key1 : "value.1.1", key2 : "value.1.2", key3 : "value.1.3.1"},
            { key1 : "value.1.1", key2 : "value.1.2", key3 : "value.1.3.2"},
            { key1 : "value.2.1", key2 : "value.2.2", key3 : "value.2.3.1"},
            { key1 : "value.2.1", key2 : "value.2.2", key3 : "value.2.3.2"},
            { key1 : "value.2.1", key2 : "value.2.2", key3 : "value.2.3.3"},
            { key1 : "value.3.1", key2 : "value.3.2", key3 : "value.3.3.1"},
            { key1 : "value.4.1", key2 : "value.4.2", key3 : "" }]}
</code></pre>

<p>How can I achieve this effectively? </p>