I have an array that I would like to filter by using only dates AFTER a certain period (the 4th column in the array). The startDate variable is the date within a cell that I would like to filter the array by. I also want to filter out the blank cells in the 4th column. I've tried a few different things, but the function is returning the entire array with JUST the blank columns filtered. Here's the latest Code I've tried.
function invPayable(){
var overview = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Overview");
var paymentLog = SpreadsheetApp.openById("1KkR4jE1c00WuQpPrexW8f9BIq5vxl0fWaUGxbeYERsE").getSheetByName("Payment Log");
var paymentArr = paymentLog.getRange(3, 1,paymentLog.getLastRow(),paymentLog.getLastColumn()).getValues();
var startDate = new Date(overview.getRange(3, 1).getValue());
var pay1 = paymentArr.map(function(r){return [r[0],r[1],r[2],r[3]]})
.filter(function(item){
if(item[3]!=""){return true}
if(item[3]>=startDate){return true}
else{return false}
});
//execute
overview.getRange(2, 18,pay1.length,4).setValues(pay1);
overview.getRange(6,1).setValue(startDate);
}//Added by editor