I have an array of objects, Like for example if I have 4 objects in the array. I just want to return those object which has status: true. Could someone please help me with how to resolve this issue?
thanks
const inputArray = [
{id: 1, status: true},
{id: 2, status: true},
{id: 3, status: false},
{id: 4, status: true},
{id: 5, status: true},
{id: 6, status: false}
];
const countDeliveredDeliveries = (array) => {
let result = array.map(function (item) {
return item.status === "Delievered";
});
console.log("@@ reesult", result);
};