Skip to content

Instantly share code, notes, and snippets.

@dkw5877
Created March 28, 2019 17:37
Show Gist options
  • Save dkw5877/65246801b1821db6d32fa461fe4b2c86 to your computer and use it in GitHub Desktop.
Save dkw5877/65246801b1821db6d32fa461fe4b2c86 to your computer and use it in GitHub Desktop.
Testing equality in collections in Swift
let strings1 = ["a", "b", "c"]
let strings2 = ["a", "b", "c"]
var isEqual = strings1 == strings2 //true
let strings1 = ["a", "b", "c"]
let strings2 = ["a", "b", "d"]
var isEqual = strings1 == strings2 //false
let strings1 = ["a", "b", "c"]
let strings2 = ["b", "c", "a"]
var isEqual = strings1 == strings2 //false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment