:) That is true, but there is "native" way (not need function to add) xD. Example in volt (variable menu contain string, tmp_dropdown is array- they can be defined in controller):
{% set tmp_dropdown = ['menu', 'texts', 'broadcasts'] %}
{% set menu = 'texts' %}
{% if menu in tmp_dropdown %}YES{% endif %}