Consider this snippet:
let interestingNumbers = [
"Prime": [2, 3, 5, 7, 11, 13],
"Fibonacci": [1, 1, 2, 3, 5, 8],
"Square": [1, 4, 9, 16, 25],
]
println(interestingNumbers["Square"])
let individualScores = [75, 43, 103, 87, 12]
println(individualScores)
The console output:
Optional([1, 4, 9, 16, 25])
[75, 43, 103, 87, 12]
Why was there an "Optional" in the dictionary case?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…