Skip to content

Instantly share code, notes, and snippets.

@ronaiza-cardoso
Created October 14, 2021 21:16
Show Gist options
  • Save ronaiza-cardoso/db9b0398fae80987721e374c44009f35 to your computer and use it in GitHub Desktop.
Save ronaiza-cardoso/db9b0398fae80987721e374c44009f35 to your computer and use it in GitHub Desktop.
Redroduzindo o comportamento da função `omit` do lodash
const omit = (obj, filterKeys) => {
return Object.keys(obj).reduce(
(acc, curr) =>
filterKeys.every(i => i !== curr) ? { ...acc, [curr]: obj[curr] } : acc,
{}
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment