November 2016
Intermediate to advanced
480 pages
14h 42m
English
Like if/else conditions, guard statements support the use of multiple clauses to perform additional checks.
Using additional clauses with a guard statement gives you further control over the statement’s condition.
Refactor the greetByMiddleName(name:) function to have an additional clause in its guard statement.
This clause should check to see if the middle name is less than four characters long.
If it is, then greet that person by their middle name.
If it is not, then use the generic greeting.
Read now
Unlock full access