Hoisting explanation with best 5 example in java script – datainflow
you can check javascript or jquery object is empty or not, because we need to check many place our jQuery object is empty, null or undefined etc., We can check this using $.isEmptyObject() as the following code under.
if($.isEmptyObject(object)){ alert("Object is empty."); }else{ alert("Object is not empty."); }
OR
if (your_object && your_object instanceof Array && !your_object.length) { console.log('Object is empty.'); } else { console.log('Object is not empty.'); }
Related posts