Fix missing return in `map` / `filter`

easy
By FrontendAtlas Editorial · Updated Oct 5, 2026
A teammate refactored a simple array pipeline to use block-bodied arrow functions because it looked more readable. The shape still looks right, but now the result comes back empty or full of undefined. Fix the missing returns without changing the overall intent of the pipeline.

Solution idea

export default function summarizeOpenTickets(tickets){

return tickets

.filter(ticket => {

return ticket.open;

})

.map(ticket => {

return ticket.title.trim().toUpperCase();

});

}

Examples
summarizeOpenTickets([{ title: ' Bug ', open: true }, { title: 'Chore', open: false }]) // ['BUG']

summarizeOpenTickets([{ title: ' Docs ', open: true }, { title: ' Test ', open: true }]) // ['DOCS','TEST']