Return to Snippet

Revision: 17381
at September 2, 2009 15:25 by jlizarraga


Initial Code
function isEmpty(obj) {
	for(var prop in obj) {
		if(obj.hasOwnProperty(prop))
			return false;
	}
	return true;
}

Initial URL


Initial Description
Use this function to test whether or not a Javascript object is empty.

Initial Title
isEmpty() - Check if Object is Empty

Initial Tags
javascript, object

Initial Language
JavaScript