Global Variables in Swift

Stop! Stop! Stop! WRONG. BAD.

Photo by Fernando @cferdo on Unsplash

Difficulty: Beginner | Easy | Normal | Challenging

Global variables are defined outside of functions, methods, closures or types. That is, they are defined at the global scope.

Local variables are variables that are defined within a function, method or closure.