What is the most elegant way to determine if all attributes in a javascript object are either null or the empty string? It should work for an arbitrary number of attributes
Here's my version, specifically checking for null and empty strings (would be easier to just check for falsy)
function isEmptyObject(o) { return Object.keys(o).every(function(x) { return o[x]===''||o[x]===null; // or just "return o[x];" for falsy values }); }