Quiz · Optionals · lesson 2 of 8Quiz — an optionalWhat is an optional in Swift, and which mistake does it catch at compile time?[A]A type like Int? that holds either a value or nil. The compiler does not check how it is used: the program stops while running, at the first line that uses an empty optional as a value, and that is the protection.[B]A type like Int? that holds either a value or nil, meaning no value. The compiler refuses to use an Int? where an Int is needed until you unwrap it, so forgetting the empty case is a compile error, not a crash.[C]A type like Int? that is never really empty: when the value is missing, Swift quietly puts in 0 or "". The compiler treats Int? exactly like Int, so a missing value turns into a default and nothing ever crashes.[D]A function parameter marked with ? that you are allowed to leave out at the call. Swift then passes nil in its place, so a call with a missing argument compiles instead of stopping the build with an error.← BackA value or nilNext →if let