I have the following function:
var rows = sheet2Json(sheet);
var emails = rows.filter(function (el) { //ONLY CHECKED ROWS.
return el != "";
})
.map(function (row) { //ONLY CHECKED ROWS.
return row['EMAIL'];
});
Logger.log(emails)
return (emails);
}
rows produces the sheet in an array of objects that looks like:
[{ EMAIL=xxx, TEMPLATE=CONSULT, Index=Thu Jan 24 16:26:02 GMT-05:00 2019 }
...
]
I want an array of all the emails filtering out the empty rows. With the code above I'm getting:
[ [email protected], [email protected], , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ]
How can I get rid of the empty rows?
