Skip to content

Instantly share code, notes, and snippets.

@hungdev
Created April 12, 2023 09:17
Show Gist options
  • Save hungdev/11b0f375ea0d98257906f8d78cd1f51b to your computer and use it in GitHub Desktop.
Save hungdev/11b0f375ea0d98257906f8d78cd1f51b to your computer and use it in GitHub Desktop.
Search all field in table
const fields = Object.keys(data?.[0]);
const searhResponse = searchVl ? data?.filter(el => fields.find(f => el[f]?.toString()?.toLowerCase()?.includes(searchVl?.toLowerCase()))) : data;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment