Last active
November 7, 2021 11:14
-
-
Save AliBahaari/878311948b1b2a7152941a19e5f0d0a5 to your computer and use it in GitHub Desktop.
A hook for checking membership of an element.
This file contains hidden or 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
| export const useArrMem = (i, arr) => { | |
| if (arr.indexOf(i) >= 0) { | |
| return true; | |
| } else { | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment