Skip to content

Instantly share code, notes, and snippets.

@salmaanahmed
Created January 28, 2019 12:29
Show Gist options
  • Save salmaanahmed/ff23b51aba6adb4a329f4ff0851375a5 to your computer and use it in GitHub Desktop.
Save salmaanahmed/ff23b51aba6adb4a329f4ff0851375a5 to your computer and use it in GitHub Desktop.
let d: [String: String?] = ["a": "1", "b": nil, "c": "3"]
let r4 = d.compactMapValues({$0})
// r4 == ["a": "1", "c": "3"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment