A GUARD statement is used to transfer the program control out of the scope when one or more conditions are not met. Using this statement helps in avoiding the pyramid of doom.
A GUARD statement will be in the following form:
guard condition else
{
Statements
}