title: Use splice and for or forEach
body: <p>I'm trying to show the coupons from a client that exist in one api. If one (or 'n') coupons exist inside of another api that counts the used coupons, i have to delete from the list that or those coupons used. The api of the used coupons response something like this:</p>
  
  <pre><code>{
  "State": 200,
  "Response": [
      {
          "IdInvoiceRequest": 104,
          "Coupons": [
              {
                  "IdCoupon": 77236,
                  "Code": "11#E5ZQHZ-GNH"
              },
              {
                  "IdCoupon": 77237,
                  "Code": "12#WM96FY-NGE"
              },
              {
                  "IdCoupon": 77239,
                  "Code": "14#BH92BA-E6N"
              },
              {
                  "IdCoupon": 77240,
                  "Code": "15#FWXNR4-XHP"
              },
              {
                  "IdCoupon": 77241,
                  "Code": "16#7FK5F8-TKM"
              }
          ]
      },
      {
          "IdInvoiceRequest": 143,
          "Coupons": [
              {
                  "IdCoupon": 77238,
                  "Code": "13#BN5MZB-VJ9"
              }
          ]
      }
  ],
  "Message": "Informacion correcta",
  "TotalRows": 0,
  "IsCorrect": true}
  </code></pre>
  
  <p>The problem comes when i try to eliminate the used coupons. My code so far:</p>
  
  <pre><code>function validExist() {
    vm.getSelected =
      couponExist.get({
        idOrder: vm.idOrder
      }).$promise.then(function(data) {
  
        for (var i = 0; i &lt; data.Response.length; i++) {
  
          data.Response[i].Select = vm.exist;
          console.log(vm.exist);
        }
  
        vm.otherF = vm.coupons
  
        for (var i = 0; i &lt; data.Response.length; i++) {
  
          data.Response[i].Select = vm.isHere;
          console.log(vm.isHere);
        }
  
        if (vm.exist == vm.isHere) {
          vm.coupons.splice(vm.coupons.IdCoupon, i++);
        };
  
      });
  }
  </code></pre>
  
  <p>When splice acts, only eliminate the very first coupon, but the others still the same, even when all the coupons are inside of the used coupon list. What can i do to delete all the coupons? I've heard that a way to do this is using 'forEach' o a few 'for', but i don't see the light (sighs).</p>
  
  <p>Can you help me?</p>
  
  <p>Thanx in advance.</p>