Checking for an object, based on a string, using Twig
After a Slack conversation with @carlcs, we discovered another slick solution...

{{ 'myVariable' in _context|keys }}



The in operator works much like PHP's in_array function.
The keys filter works just like PHP's array_keys function.