Skip to content

Instantly share code, notes, and snippets.

@martinhoeller
Created June 2, 2020 11:41
Show Gist options
  • Save martinhoeller/84750b41f5f704507188de45ed9bb522 to your computer and use it in GitHub Desktop.
Save martinhoeller/84750b41f5f704507188de45ed9bb522 to your computer and use it in GitHub Desktop.
import Foundation
extension Array where Element: Hashable {
/**
Returns a new array containing only the unique elements of the receiver.
- warning: There are no guarantees about the order of the returned array.
*/
var uniqued: Self { Array(Set(self)) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment