Last active
October 26, 2016 13:23
-
-
Save marcusshepp/dd94abbfd25e645eba233fbc4419a8f7 to your computer and use it in GitHub Desktop.
is object empty
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 is_empty(obj){ | |
return Object.keys(obj).length === 0; | |
} | |
// alternative | |
function isEmpty(object) { | |
for(var i in object) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment