Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
extension Dictionary {
func duplicated() -> Dictionary<Key, Value> {
return reduce(into: [Key: Value]()) { (dict, item) in
dict[item.key] = item.value
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment