see the object length | javascript

PHOTO EMBED

Thu May 02 2024 05:56:26 GMT+0000 (Coordinated Universal Time)

Saved by @codejck #javascript

var oii = {
    name: "jigar",
    work: "it",
    myname: {
        firstname: "jigar",
        lastname: "kajiwala"
    }
}

if (Object.keys(oii).length != 0) {
    console.log(`oii is not empty`);        //oii is not empty
    console.log(Object.keys(oii).length);   //3
}
content_copyCOPY