0 votes
14 views
What is a GUARD statement? What is the benefit of using the GUARD statement in swift?
in Technology by (186k points)

1 Answer

0 votes

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
}
by (186k points)

Related questions

0 votes
1 answer 10 views
10 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 12 views
12 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 11 views
11 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 19 views
19 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 9 views
0 votes
1 answer 7 views
7 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 9 views
9 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 11 views
11 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 15 views
0 votes
1 answer 18 views
0 votes
1 answer 14 views
14 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 14 views
14 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 15 views
0 votes
1 answer 29 views
0 votes
1 answer 16 views
0 votes
1 answer 8 views
8 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 11 views
11 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 14 views
0 votes
1 answer 38 views
0 votes
1 answer 12 views
0 votes
1 answer 22 views
0 votes
1 answer 16 views
16 views asked Nov 30, 2020 in Technology by JackTerrance (186k points)
0 votes
1 answer 11 views
...