Swift - Optionals
Identify the error in this Swift code:
var value: Int? value = 5 print(value!)
var value: Int? value = 5 print(value!)
value! force unwraps the optional without checking if it is nil.value is assigned 5, force unwrap works here, but if it were nil, it would cause a runtime error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions