Loading…

What is a guard statement?

These are control flow statements that can be a great addition if you are doing defensive style programming. These statements evaluate a boolean condition and proceed with the execution only if the evaluation is real. Such statements always have an else clause.
guard let courses = student.courses! else {
   return
}

Suggest An Answer

No suggestions avaliable!

Latest post from Swift Interview Questions

Ask Question