Are there any performance issues when pushing objects to $scope.array versus var x = [ ] in AngularJS?
<p>I often need to do things like this:</p>

<pre><code>$scope.my_array = [];
var obj;

for (var i = 0; i &lt; data.length; i++) {
    obj = {};
    obj.item1 = data.something;
    obj.item2 = data.somethingElse;
    $scope.my_array.push(obj);
}
</code></pre>

<p>Is this less performant than doing the following:</p>

<pre><code>var my_array = [];
var obj;

for (var i = 0; i &lt; data.length; i++) {
    obj = {};
    obj.item1 = data.something;
    obj.item2 = data.somethingElse;
    my_array.push(obj);
}

$scope.my_array = my_array;
</code></pre>

<p>My suspicion is that the first version may cause the digest cycle to be run each time an object is pushed into the array, whereas in the 2nd version it won't. Is this correct? Basically, what is the best way to do the above?</p>