Last active
August 29, 2015 14:04
-
-
Save apellizzn/fd08706e080c1f4e30ce to your computer and use it in GitHub Desktop.
Javascript function that takes in input an object and return it without each attributes with value undefined, null, ""
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 normalizeObject(object){ | |
for(var index in object) { | |
console.log(!object[index]); | |
if(!object[index] && object[index]!== false && object[index]!==0){ | |
delete object[index] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment