Created
July 16, 2021 14:49
-
-
Save wolftrax5/0dac94df5e55c68d9372b21f0aeeffc4 to your computer and use it in GitHub Desktop.
Filter/Search
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
/* | |
* @param row Array of Objects | |
* @param filterKey String | |
* @return Array of Objects | |
*/ | |
const getFilteredRows = (rows, filterkey) => ( | |
rows.filter((row) => JSON.stringify(row).toLowerCase().includes(filterkey)) | |
); | |
/* | |
This is fast & dirty fuction to get elements of array objects | |
a problem with this is if you type "{" or <key> name of the object will return | |
the data too | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment