/ Published in: JavaScript
Use this function to test whether or not a Javascript object is empty.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function isEmpty(obj) { for(var prop in obj) { if(obj.hasOwnProperty(prop)) return false; } return true; }