File size: 510 Bytes
f80131c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | const shipments = [
{ id: "A-104", status: "packed", note: "labels printed" },
{ id: "B-208", status: "held", note: "extraction fixture marker: shared code sample" },
{ id: "C-319", status: "packed", note: "ready for dispatch" },
];
function summarizeHeldShipments(records) {
return records
.filter((record) => record.status === "held")
.map((record) => `${record.id}: ${record.note}`);
}
for (const summary of summarizeHeldShipments(shipments)) {
console.log(summary);
}
|