Question 1/12: This code is valid Swift – true or false?
Hint: Trying to read a dictionary using a key that doesn't exist is valid, but won't return any data. Click to show.
let ships = ["Star Trek", "Enterprise"] let enterprise = ships["Star Trek"]
Correct! This attempts to use an array like a dictionary, which is invalid.
Oops – that's not correct. This attempts to use an array like a dictionary, which is invalid.
Link copied to your pasteboard.