Skip to content

Instantly share code, notes, and snippets.

@mohammad-mghn
Created April 27, 2023 13:42
Show Gist options
  • Save mohammad-mghn/18c75de976e5ac0698ca966ce3edee8e to your computer and use it in GitHub Desktop.
Save mohammad-mghn/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