Avoid global variables in JavaScript
– advanced-inertia.com - submitted by Boris Lepikhin
Avoid global variables in JS. You can never be sure that the variable you are referring to is even present on the `window` object. Instead, they could be easily swapped by ES6 singletons, bringing you type-safety and direct IDE support.
Read more [advanced-inertia.com]