I have 8 objects inside an array. each object contains 2 params like total: 15, name: "vijayaragavan"
so from that array i want to get 3 objects as an array and 2 objects as an array and 3 objects as an array
how to do that
what i have done is
const interviews = [allEnumValues[0], allEnumValues[1], allEnumValues[5]];
const totalIntervies = countData.filter(function(itm){
return interviews.indexOf(itm._id) > -1;
});
const sumOfInterviews = totalIntervies.reduce(function (previous, current) {
return previous + current.total;