Learning swift 3.1 by reading Language Guide (developer.apple.com). I learned that in swift the assignment operator (=) does not return a value. In control flow chapter got an example of guard statement:
func greet(person: [String: String]) {
guard let name = person["name"] else {
return
}
print("Hello \(name)!")
guard let location = person["location"] else {
print("I hope the weather is nice near you.")
return
}
print("I hope the weather is nice in \(location).")
}
My question is if '=' operator does not return value then:
guard let name = person["name"] else {
return
}
How does guard determine name = person["name"] is true or false and depending on that go to else and return?