Daily iOS
Swift

Why optionals exist

Why does Swift have optionals?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

An optional puts 'this may have no value' into the type so the compiler can force you to handle nil.

Share a question