Created
April 27, 2023 13:42
-
-
Save mohammad-mghn/18c75de976e5ac0698ca966ce3edee8e to your computer and use it in GitHub Desktop.
delete properties of a object in typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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