simplify arrays#flatten

This commit is contained in:
Johannes Rieken
2017-10-03 11:26:16 +02:00
parent 31b7b4f7d4
commit d8e2074643
+1 -1
View File
@@ -367,7 +367,7 @@ export function commonPrefixLength<T>(one: T[], other: T[], equals: (a: T, b: T)
}
export function flatten<T>(arr: T[][]): T[] {
return arr.reduce((r, v) => r.concat(v), []);
return [].concat(...arr);
}
export function range(to: number): number[];