Last active
May 11, 2018 00:18
-
-
Save Avaray/a33ad96c5a39f007feff282527534438 to your computer and use it in GitHub Desktop.
[JS] Delete empty Keys from Object
This file contains 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
function clean(o) { | |
Object.keys(o).forEach(k => (!o[k] && o[k] !== undefined) && delete o[k]); | |
return o; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment