Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Test For an Empty Object Using jQuery</title> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script> // Testing few values document.write(jQuery.isEmptyObject({}) + "<br>"); // Prints: true document.write(jQuery.isEmptyObject({name: "Harry", age: 18}) + "<br>"); // Prints: false document.write(jQuery.isEmptyObject(null) + "<br>"); // Prints: true document.write(jQuery.isEmptyObject(undefined)); // Prints: true </script> </head> <body style="font-family: monospace;"> <!-- Result will be printed here --> </body> </html>