title: What is the difference between elementsEqual and '==' in Swift?
body: <p>I'm going through the Swift Standard Library, and I came across the method <a href="https://developer.apple.com/documentation/swift/array/2853688-elementsequal" rel="noreferrer">elementsEqual</a> for comparing sequences. </p>
  
  <p>I'm not really seeing the value of this function because it will only return true if the order is exactly the same. I figured this would have some use if it could tell me if two sequences contained the same elements, they just happen to be in a different order, as that would save me the trouble of sorting both myself. </p>
  
  <p>Which brings me to my question: </p>
  
  <p>Is there any difference between using elementsEqual and '==' when comparing two sequences? Are there pros and cons for one vs the other?</p>
  
  <p>I am in my playground, and have written the following test:</p>
  
  <p><code>let values = [1,2,3,4,5,6,7,8,9,10]
  let otherValues = [1,2,3,4,5,6,7,8,9,10]
  values == otherValues
  values.elementsEqual(otherValues)</code></p>
  
  <p>both of these checks result in true, so I am not able to discern a difference here.</p>