JS get value of || operator if its true then print it

thank you for coming and read my question.
I wrote this section of JavaScript code and it worked well when i insert static class.
What i want to get here is the true value of the if statement, i mean if menuDiv.classList.contains('bg-dark') then classList.add bg-dark but i want it to be dynamic when the bg-dark or bg-secondary and etc actually exist only then the classList.add will add the same bg-* as the exist one.

function SearchButtonBG_Get() {
    const menuDiv = document.querySelector('.tecnightbsnav ');
    const searchDivColor = document.querySelector(".search-inline");
    if (menuDiv.classList.contains('bg-dark' || 'bg-secondary' || 'bg-primary' || 'bg-light')) {
        searchDivColor.classList.add(valueOfcontains, 'shadow');
        menuDiv.classList.remove('shadow')
    }
}
SearchButtonBG_Get();

If only i could print or get the value of the true || that it read so i could take that value and print it as HTML class because my system works on Bootstrap which means many classes.
The words valueOfcontains means the actual value the system return of the true value that i could not find out how to print.

I tried to find out how to get the value of true || and print it as a string or something like that but i could not find how to to it.