When guard
fails the condition, they exit the closure. However, what confuses me what is considered to be a block the guard exits out of?
For example, if I have the following:
func doThing() {
while ... {
for ... {
if ... {
guard ... else { return }
}
}
}
}
Does the guard
exit just the if
, for
, while
, or entire func
?
What is the actual rule because I've read block
and closure
terms used interchangeably when defining what the guard
exits out of, but each term implicate things differently.