Resolved: I now understand that each filter requires an explicit return statement. I mistakenly thought the single boolean in each filter would suffice. by @adiga
I am trying to identify elements in one array (dcm) that do not appear in a second array (vari). Specifically, I am looking for matches based on two elements - vp (string type) and vd (date type). While I have ensured there are rows in dcm that meet this criteria, I am not getting any results.
Could I have made a mistake in my code? Is there a better way to achieve this using methods like .includes, .contains or .indexOf?
var dcmm = dcm.filter(r=>{
vari.filter(rv=>{
rv[vp]+rv[vd] == r[dp]+r[dd]
}).length == 0
});
ps. Apologies to those who prefer shorter variable names and advocates of using const instead of var. pps. Although this is Google Apps Script and not JavaScript, I believe the concept remains the same.