Get Difference Between Two Arrays Swift

[Solved] Get Difference Between Two Arrays Swift | Vb - Code Explorer | yomemimo.com
Question : swift find difference between two arrays

Answered by : upset-unicorn-62eall96mf2f

extension Array where Element: Hashable { func difference(from other: [Element]) -> [Element] { let thisSet = Set(self) let otherSet = Set(other) return Array(thisSet.symmetricDifference(otherSet)) }
}

Source : https://www.hackingwithswift.com/example-code/language/how-to-find-the-difference-between-two-arrays | Last Update : Fri, 04 Dec 20

Answers related to get difference between two arrays swift

Code Explorer Popular Question For Vb