title: Copy an array to another array on condition
body: <p>I am searching a neat way of copying the array list to another based on some condition. I dont want to copy element by element. this is time taken also, and ofcourse with lots of lines</p>
  
  <p><strong>MYJSON</strong></p>
  
  <pre><code>$scope.leadsDataSource=[{
              id: 1,
              type: 1,
              typeName: "Lead",
              client: 1,
              clientName: "Ljungbloms Elektriska AB",
              marking: "Marking for Ljungbloms Elektriska AB",
              status: 2,
              statusName: "Open",
              stage: 2,
              stageName: "Stage 2",
              leadValue: 1,
              probability: 1,
              issuer: 1,
              issuerName: "Sales",
              handler: 1,
              handlerName: "Sales",
              created: 1462345200000,
              createdString: "2016-05-04"
          }, {
              id: 2,
              type: 1,
              typeName: "Lead",
              client: 2,
              clientName: "Solina Sweden AB",
              marking: "Marking for Solina Sweden AB",
              status: 1,
              statusName: "Closed",
              stage: 3,
              stageName: "Stage 3",
              leadValue: 1,
              probability: 1,
              issuer: 1,
              issuerName: "Sales",
              handler: 1,
              handlerName: "Sales",
              created: 1462345200000,
              createdString: "2016-05-04"
          }, {
              id: 3,
              type: 2,
              typeName: "Opportunity",
              client: 3,
              clientName: "H &amp; M Hennes &amp; Mauritz GBC AB",
              marking: "Marking for H &amp; M Hennes &amp; Mauritz GBC AB",
              status: 3,
              statusName: "Pending",
              stage: 4,
              stageName: "Stage 4",
              leadValue: 1,
              probability: 1,
              issuer: 1,
              issuerName: "Sales",
              handler: 1,
              handlerName: "Sales",
              created: 1462345200000,
              createdString: "2016-05-04"
          }];
  </code></pre>
  
  <p><strong>Condition Script</strong></p>
  
  <pre><code> var dataSource=[];
          angular.forEach($scope.leadsDataSource, function (value, key) {
              if(value.typeName=='Lead'){
                   //**copy the row to dataSource**
              }
          });
  </code></pre>
  
  <p>Is there any neat way, where I dont have to push each element??</p>