Edit in JSFiddle

* Check to see if an object has any keys.
* @param {Object} obj
* @return {Boolean}
* @author Larry Battle <bateru.com/news>
* @license WTFPL
var isObjectEmpty = function( obj ) {
	var name;
	for ( name in obj ) {
		return false;
	return obj != null && typeof obj === "object";
	test("test isObjectEmpty() good input", function(){
		equal( isObjectEmpty({}), true);
		equal( isObjectEmpty(/regex/), true);
    test("test isObjectEmpty() bad input", function(){
		equal( isObjectEmpty(true), false);
		equal( isObjectEmpty(false), false);
		equal( isObjectEmpty(null), false);
		equal( isObjectEmpty(function(){}), false);
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
        <link rel="stylesheet" href="http://code.jquery.com/qunit/git/qunit.css" type="text/css" media="screen" />
        <h1 id="qunit-header">QUnit example</h1>
        <h2 id="qunit-banner"></h2>
        <div id="qunit-testrunner-toolbar"></div>
        <h2 id="qunit-userAgent"></h2>
        <ol id="qunit-tests"></ol>
        <div id="qunit-fixture">test markup, will be hidden</div>
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/qunit/git/qunit.js"></script>