Last active
May 14, 2019 09:33
-
-
Save dir01/5c429c5ccb578602bffa69e0867e75eb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const flatten = <T>(arr: T[][]): T[] => ([] as T[]).concat(...arr); | |
test("flatten", () => { | |
expect(flatten([[1], [2], [3, 4]])).toEqual([1, 2, 3, 4]); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment