Int? mightBeNull = map["foo"]; Int neverNull = map.getOrDefault("foo", 0); if (Int n := map.get("foo")) { // if "foo" is in the map, then the variable "n" is set to its value } else { // if "foo" is not in the map, then the variable "n" is not defined }