Last active
October 24, 2020 14:38
-
-
Save exuanbo/f51acf9b633855a031d3f7851380ae91 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
// https://stackoverflow.com/a/34152244/13346012 | |
export const hasSubArray = <T>(master: T[], sub: T[]): boolean => | |
sub.every( | |
((index: number) => (value: T) => | |
(index = master.indexOf(value, index) + 1))(0) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment