Summate value of matching property in an array in Javascript
<p>In C#, we have a <code>.Sum(Predicate)</code> method that lets you use a lambda expression to do a summation over a collection of objects. For instance, if I had the following set of objects (using JSON for simplicity)</p>

<pre><code>[
  {
    "Id": 1,
    "Sub": {
      "Size": 1
    }
  },
  {
    "Id": 2,
    "Sub": {
      "Size": 3
    }
  }
]
</code></pre>

<p>And I wanted to get the sum of the sizes, I could do <code>Sum(n =&gt; n.Sub.Size)</code></p>

<p>Is there a way to do something like this in javascript? I am really new (and weak) at the language and am having trouble performing a similar function. I am using jQuery, so I am open to that opening anything too.</p>
