score:1

Accepted answer
employees.forEach(emp => {
    if (testArr.some(item => moment(emp.startdate).format('M-YYYY') == item) &&
      testArr.some(item => (moment(emp.enddate).format('M-YYYY') > item))) {
        result.push(emp);
    }
});

score:0

var filteredEmployees = employees.filter(function(){
   // your filter here
});
var mapEmployees = filteredEmployees.map(...);

Related Query

More Query from same tag