First of all, please answer without giving me negative reputation, since I searched for this responsably before posting.
I want to filter an array of players, first the ones who has an "a" in their names, from these the ones who has an "e" and lastly from the ones who pass the two previously mentioned filters, the ones who start with z. I tried three methods individually no problems are all, but put together it does not filter, not even once.
const players2 = ["veron", "cambiasso", "batistuta", "zanetti", "Dalessandro", "zamerano", "cae", "cea", "cerini", "zii"];
const filter3 = (players) => (players.filter(
player => {
player.startsWith('z');
return player;
})
.filter(
player => {
player.includes('e');
return player;
})
.filter(
player => {
player.includes('a');
return player;
}
));
console.log("Argentineans players filtered are: " + filter3(players2));