Sometimes you get a dictionary where the values are unknown. If you know this map holds numbers, you can assert the value type when reading.
You will sum numeric values from a { [key: string]: unknown } object.
const m: { [k: string]: unknown } = { a: 1, b: 2 };
let total = 0;
for (const k in m) total += m[k] as number;
Add up all numeric values from a map with unknown values.