Junior — Senior
Bug detection in Swift code
livecode
Task condition
In this Swift code fragment, it is necessary to find and explain the errors.
struct Person {
let name:String
func greetings1(){
{ [self] in
print("Hello,\(self.name)")
}()
}
func greetings2(){
{ [self] in
print("Hello,\(self?.name)!")
}()
}
func greetings3(){
{ [self] in
print("Hello,\(self?.name)!")
}()
}
}