export function sum(a: Array): number { let r = 0; for (const v of a) { r += v; } return r; }