Want to sum of values with same property name in object using javascript or jquery : <p>Hi I want to do sum of the quantity for each reason name.And I have 2 arrays as per below.</p>

<pre><code>var allreasonsids=[];
 allreasonsids = [
   {reasonid: 1, reasonname: abc}, 
   {reasonid: 2, reasonname: def}, 
   {reasonid: 3, reasonname: ghi}, 
   {reasonid: 4, reasonname: jkl}
];


var reasonsandcount=[];
reasonsandcount=[
{reasonid: 1, quantity: 5},
{reasonid: 2, quantity: 10},
{reasonid: 1, quantity: 3},
{reasonid: 3, quantity: 4},
{reasonid: 1, quantity: 2},
{reasonid: 2, quantity: 6}
];
</code></pre>

<p>I want the result as per below:</p>

<p><strong>Output:</strong>
abc :10</p>

<p>def:16</p>

<p>ghi:4</p>

<p>jkl:0</p>

<p>Please suggest me any answer.
Thank You.</p>
