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
Using Array.some() and check if the values are not null and not empty is more efficient than using Array.every and check it the other way around.
const isEmpty = !Object.values(object).some(x => (x !== null && x !== ''));
This answer should just make the excellent comment of user abd995 more visible.