conditions – How to check if at least two out of several values ​​are true?

How to check if at least two values ​​are true (or not null)?

For example,

var value1 = null;
var value2 = null;
var value3 = null;

// code defining one or more values

// if more than one value is defined, add titles to separate them
if ((value1 && value2) || (value1 && value3) || (value2 && value3)) {
// add separate titles
}

I use a language like JavaScript. I use JavaScript.