minetest.global exists

Description
Checks if a global variable named name has been set, without triggering a warning.

(Note: Added after 0.4.12)

Parameters

 * name - The name of the global variable. This is a string, not a reference to the variable itself.  For example, to test for the existence of a variable my_global, use   (noting the use of quotes).

Examples
Slightly more complicated because of short-circuit logic, but a bit more concise: