Can this be written much more simplistically using a foreach?
<pre><code>function GetDiagrams(componentID) {
    $.getJSON("../PlanView/GetDiagrams", { ComponentID: componentID }, function (diagrams) {
        for (var i = 0; i &lt; diagrams.length; i++) {
            PaintDiagram(diagrams[i]);
        }
    });
}
</code></pre>

<p>All I am doing is calling PaintDiagram on each element returned. I tried Googling for a bit because I am pretty confident this is easily reducible, but was not able to pull up a quick example.</p>

<p>Is this function a candidate for any more refactoring?</p>
