Skip to content

Instantly share code, notes, and snippets.



Last active May 29, 2019
What would you like to do?
isEmpty, a javascript helper for checking if objects are empty.
// check all properites in a object as explained by Viktor Borisov on
function isEmpty(obj) {
for(var prop in obj) {
if(obj.hasOwnProperty(prop)) return false;
return true;
// use Examples
isEmpty({}); // true
}); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.