[Solved] how to check if an object has at least one true value [duplicate]


Assuming that values is actually an object, check if .some of the Object.values of the object are true:

const values = {de: true, en: false, nl: false, pl: false, ru: false};

const someTruthy = Object.values(values).some(val => val === true);
console.log(someTruthy);

(if the only truthy value is true, you can use (val => val) instead)

solved how to check if an object has at least one true value [duplicate]