jQuery isEmptyObject() example

jQuery isEmptyObject() function is used to check to see if an object is empty (contains no enumerable properties).


jQuery.isEmptyObject( object )
object - The object that will be checked to see if it's empty.


Check an object to see if it's empty.
<!doctype html>
<html lang="en">

    <meta charset="utf-8">
    <title>jQuery.isEmptyObject demo</title>
    <script src="https://code.jquery.com/jquery-3.4.1.js"></script>

        jQuery.isEmptyObject({}); // true
            foo: "bar"
        }); // false


Try it Yourself - Copy paste code in Online HTML Editor to see the result


Free Spring Boot Tutorial - 5 Hours Full Course

Watch this course on YouTube at Spring Boot Tutorial | Fee 5 Hours Full Course