`map` returns a new array of the same length, `filter` returns a subset, and `reduce` folds to a single value. All three leave the original array untouched.
const total = txs .filter((t) => t.status === "ok") .map((t) => t.value) .reduce((a, b) => a + b, 0n);
Always give `reduce` an initial value — an empty array without one throws.