Loading…
december code / try / swift
No account needed. Answer, see why, move on.
Problem
What happens when this Swift code is compiled and run?
var ages = ["ana": 21] ages["li"] = 30 ages["ana"] = nil print(ages.count, ages["ana"] == nil)
2 true
2 false
1 true
It does not compile: nil cannot be assigned to an Int value
Nothing here is saved. Create a free account to keep your progress, take an assessment and get your readiness score.