In PHP we can check if a key exists in an array by using the function array_key_exists().
array_key_exists()
In the Twig templating language we can check if an variable or
You can use the keys twig function
keys
{% if myVar in someOtherArray|keys %}