Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

check object is empty javascript

if(
objectName  // Verify object presence
&& Object.keys(objectName).length === 0  // Verify object content
&& Object.getPrototypeOf(objectName) === Object.prototype // Verify object type
) {
 // Run truthy condition. 
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #object #empty #javascript
ADD COMMENT
Topic
Name
7+8 =