Created
August 30, 2018 19:06
-
-
Save juanbrusco/6d32cf4cfa1dc76531c374d093d5823c to your computer and use it in GitHub Desktop.
Check empty - Javascript
This file contains hidden or 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
isEmpty(myObject) { | |
for(var key in myObject) { | |
if (myObject.hasOwnProperty(key)) { | |
return false; | |
} | |
} | |
return true; | |
}; | |
if(this.isEmpty(xObject){ | |
console.log('is empty') | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment