This sounds like some generic helper function, but it's actually very specific to elements with `id` and `value`. I think an inline-`reduce()` would be more clear.