not that it matters much, but this would be a good candidate for generic typing:
`flatten<T>(a: T[][]): T[]`