Global variables have their own workspace, which is separate from the base and function workspaces.
Using global variables is inefficient.
Also, global variables carry notable risks. Any function can access and update a global variable. Other functions that use the variable might return unexpected results. For example:
If you unintentionally give a “new” global variable the same name as an existing global variable, one function can overwrite the values expected by another. This error is difficult to diagnose.
If a global variable is changed in multiple functions, calling those functions in a different order can lead different results.
Use global variables sparingly, if at all.
For more information on variables and the workspace, see Global Variables subsection on Share Data Between Workspaces page.