Question from the Swift test

How to check if a variable is defined in Swift