Javascript approach to copy properties of first array(of objects) into another array(of objects) of different lengths
<p>I have an object array say </p>

<pre><code>srcObj = [{a:1, b:2}, {c:3, d:4}]

destObj = [{a:1, b:2}]
</code></pre>

<p>I want to copy values of this array into another array that may have a shorter length than the above srcObj array. How would I construct the loop to increase the length of destObj array depending on the size of srcObj array and then insert the missing items from srcObj array to destObj array.</p>