title: Check if array contains something - Swift 4
body: <p>I've found the .contains(Element) method pretty essential in my minimal experience writing Swift code, and have quickly realized that Apple changed it...</p>
  <pre><code>func contains(check:[[[Int]]], forElement: [[Int]]) -&gt; Bool {
      for element in check {
          if areEqual(element, forElement) {
              return true
          }
      }
      return false
  }
  func areEqual(_ a:[[Int]], _ b:[[Int]]) -&gt; Bool {
      for i in 0..&lt;a.count {
          if a[i] != b[i] {
              return false
          }
      }
      return true
  }
  </code></pre>
  <p>I've been messing with some large arrays, so I fixed my problem with that clunky function.</p>
  <p>What happened?</p>
  <p>How do you use <a href="https://developer.apple.com/documentation/swift/array/2297359-contains" rel="nofollow noreferrer">the new way</a>?</p>
  <p>The example there is well over my head.</p>
  <pre><code>enum HTTPResponse {
      case ok
      case error(Int)
  }
  
  let lastThreeResponses: [HTTPResponse] = [.ok, .ok, .error(404)]
  let hadError = lastThreeResponses.contains { element in
      if case .error = element {
          return true
      } else {
          return false
      }
  }
  // 'hadError' == true
  </code></pre>