title: angularjs - `factory` copy and local copy
body: <p>I get all my <code>allusers</code> array from <code>myfactory</code>:</p>
  
  <pre><code>$scope.allusers = myfactory.getFactoryOriginalAllUsers();
  ///[1,2,3]
  
  $scope.allusers.splice(0,1);
  ///[2,3]
  </code></pre>
  
  <p>but when I want my original</p>
  
  <pre><code>$scope.allusers2 = myfactory.getFactoryOriginalAllUsers();
  ///[2,3]
  </code></pre>
  
  <p>Why is <code>$scope.allusers2</code> the same as <code>$scope.allusers</code>? Shouldn't it be still the same as original factory copy which is <code>[1,2,3]</code>?</p>
  
  <p>How can I keep the original factory copy untouched?</p>