// This function takes a user ID and a list of orders,
// filters the orders to only those belonging to the user,
// then sums the total amount across them and returns it.
function sumUserOrders(userId: string, orders: Order[]): number {
return orders
.filter(o => o.userId === userId)
.reduce((sum, o) => sum + o.amount, 0)
} Deterministic comment-block parse: flags consecutive comment lines that paraphrase the immediately following declaration.