Determines if a variable exists in the current scope.
This function does not generate a change.
has_var(var)
| Argument | Type | Description |
|---|---|---|
| var | str (required) | Variable name to check. |
Returns true if a variable with the given name exists in the current scope (even if its value is nil) and otherwise false.
This code shows an example use case of has_var():
x = nil;
[
has_var('x'),
has_var('y'),
];
Return value in JSON format
[
true,
false
]