Skip to content

Instantly share code, notes, and snippets.

@wolftrax5
Created July 16, 2021 14:49
Show Gist options
  • Save wolftrax5/0dac94df5e55c68d9372b21f0aeeffc4 to your computer and use it in GitHub Desktop.
Save wolftrax5/0dac94df5e55c68d9372b21f0aeeffc4 to your computer and use it in GitHub Desktop.
Filter/Search
/*
* @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