Here
function emailClients(clients) {
clients
.filter(isClientActive)
.forEach(email);
}
function isClientActive(client) {
const clientRecord = database.lookup(client);
return clientRecord.isActive();
}
the function name suggests that all client will be emailed. I'd rather do
function emailActiveClients(clients) {
clients
.filter(isActive)
.forEach(email);
}
function isActive(client) {
const clientRecord = database.lookup(client);
return clientRecord.isActive();
Here
the function name suggests that all client will be emailed. I'd rather do