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