This question already has an answer here:
- Map and filter an array at the same time 10 answers
many times I need to loop arrays to get only specific items inside that.
here's an example:
let girls = [];
this.kidsArray.forEach(function(v){
if(v['genre'] == 'f'){
girls.push(v.id);
}
});
so, is there any simpler/cleaner way to do this? maybe with filter/map array methods, or something like that?