Concat in a for loop google app scripts javascript

I’m trying to filter in an array by data in another array using concat in a for loop. The elements of the following code are logging correctly, but the final array is logging an empty array.

function Shipments (){
  var app = SpreadsheetApp;
  var movementSS = app.getActiveSpreadsheet();
  var infoSheet = movementSS.getSheetByName("Update Info");
  var orderInfoSheet = movementSS.getSheetByName("Order Info");

  var targetSheet = movementSS.getSheetByName("Shipments");
  var ShipLogSS = app.openByUrl(URL).getSheetByName("Shipping Details");


  var ShipArr = ShipLogSS.getRange(3,1,ShipLogSS.getLastRow(),ShipLogSS.getLastColumn()).getValues().
    filter(function(item){if(item[1]!=""){return true}}).
    map(function(r){return [r[0],r[1],r[2],r[4],r[10],r[11],r[16],r[18],r[23]]});

  var supplierData = orderInfoSheet.getRange(3,6,orderInfoSheet.getLastRow(),1).getValues().
    filter(function(item){if(item[0]!=""){return true}});


  var supplierList = [];
  for (var i in supplierData) {
    var row = supplierData[i];
    var duplicate = false;
    for (var j in supplierList) {
      if (row.join() == supplierList[j].join()) {
        duplicate = true;
      }
    }
    if (!duplicate) {
      supplierList.push(row);
    }
  }

  var supplierFilter = [];
  for(var i = 0; i < supplierList.length; i++){
    var shipments = ShipArr.filter(function(item){if(item[4]===supplierList[i][0]){return true}});
    supplierFilter.concat(shipments);
  }

  Logger.log(supplierFilter);

}

Any help would be greatly appreciated!

148 thoughts on “Concat in a for loop google app scripts javascript”

  1. Pingback: viagra
  2. Pingback: discount viagra
  3. Pingback: sex pills cialis
  4. Pingback: cialis for men
  5. Pingback: sildenafil
  6. Pingback: sildenafil 50mg
  7. Pingback: reddit cialis
  8. Pingback: tadalafil avis
  9. Pingback: generic for viagra
  10. Pingback: sildenafil 20 mg
  11. Pingback: otc viagra
  12. Pingback: cheap viagra
  13. Pingback: levitra
  14. Pingback: viagra boys
  15. Pingback: viagra meaning
  16. Pingback: cost of viagra
  17. Pingback: chewable viagra
  18. Pingback: viagra alternative
  19. Pingback: generic viagra
  20. Pingback: viagra for sale

Leave a Comment