Skip to content

Instantly share code, notes, and snippets.

@marcusshepp
Last active October 26, 2016 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusshepp/dd94abbfd25e645eba233fbc4419a8f7 to your computer and use it in GitHub Desktop.
Save marcusshepp/dd94abbfd25e645eba233fbc4419a8f7 to your computer and use it in GitHub Desktop.
is object empty
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