Last active
October 9, 2021 07:08
-
-
Save fuji44/d9ae4d6a1247d31ef552745ee9b19855 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 unique = <T>(targets: Array<T[]>): T[] => { | |
return [ | |
...new Set( | |
targets.reduce((result, current) => { | |
return result.concat(current) | |
}, []) | |
), | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment