Created
June 21, 2022 09:39
-
-
Save manabuyasuda/c0fe6fb0002629a785fdcef828d2123c 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
/** | |
* 配列を比較して、1つでも重複があれば`true`を返す | |
* @param {Array} arr1 | |
* @param {Array} arr2 | |
* @returns {Boolean} | |
*/ | |
const isDuplicateArray = (arr1, arr2) => { | |
return ( | |
[...arr1, ...arr2].filter(item => arr1.includes(item) && arr2.includes(item)).length > 0 | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment