Skip to content

Instantly share code, notes, and snippets.

@vito-mohagheghian
Created April 27, 2023 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vito-mohagheghian/18c75de976e5ac0698ca966ce3edee8e to your computer and use it in GitHub Desktop.
Save vito-mohagheghian/18c75de976e5ac0698ca966ce3edee8e to your computer and use it in GitHub Desktop.
delete properties of a object in typescript
const deleteProperties = (obj: any, propertiesToDelete: string[]) => {
for (const property of propertiesToDelete) {
delete obj[property];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment