0
Why use the standard declaration when you can use global?
2 Réponses
0
You may want to use the same variable name in two different classes. Promoting every var to a global not only slows down your code due to overloading, but screws up the OOP coding.
0
Technically, because we aren't using OOP in this example, all the code is in the global scope. That said, it's generally unwise to declare variables global as it makes testing much more complex.