Check Three Dom Elements to See if they are empty or not and return detailed result
After speaking with some friends, this is seen as the best solution. One adjustment to the return values was required however; change the casing from camel case to title case. I am also using constants to make sure that return values can be consistently used properly.
/**
 * Check the three dom elements to see if they are empty or not and return detailed result.
 * @param {jQuery|HTMLElement} area Area input field.
 * @param {jQuery|HTMLElement} city City input field.
 * @param {jQuery|HTMLElement} text Text input field.
 * @return {string} Detailed result of which input fields are empty.
 * If all are filled, returns &quot;all&quot;.
 * If none are filled, returns empty string.
 */
export const processValues = (area, city, text) =&gt; {
    const a = (area.val()) ? 'Area' : '';
    const c = (city.val()) ? 'City' : '';
    const t = (text.val()) ? 'Text' : '';
    if (a !== &quot;&quot; &amp;&amp; c !== &quot;&quot; &amp;&amp; t !== &quot;&quot;) {
        return &quot;all&quot;;
    } else {
        return a + c + t;
    }
};

export const ALL = &quot;all&quot;;
export const AREA_CITY = &quot;AreaCity&quot;;
export const AREA_TEXT = &quot;AreaText&quot;;
export const AREA = &quot;Area&quot;;
export const CITY_TEXT = &quot;CityText&quot;;
export const CITY = &quot;City&quot;;
export const TEXT = &quot;Text&quot;;
```