Deviopath › Swift

Unwrap a Name

Easy · Optionals

String? is either a string or nil. if let name = name unwraps it. The nil-coalescing operator ?? supplies a default.

Write displayName(_:) that returns the name, or "Anonymous" when it is nil.

Next: Count Vowels