DEV Community

Lakshya Tyagi
Lakshya Tyagi

Posted on

Javascript function to check is object empty or not

function isObjectEmpty(obj) {
    for (var key in obj) {
        if (obj.hasOwnProperty(key))
            return false;
    }
    return true;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)