title: Difference between [(key: String, value: String)] and [String:String] dictionary
body: <p>I am using this flatmap function to return a dictionary but it is returning  <code>[(key: String, value: String)]</code> instead. What is the difference between  <code>[(key: String, value: String)]</code>  and a dictionary? Here is the code I am using. What would be the best way to do this. <code>totalResponseArray</code> is a custom class of type <code>Array&lt;Duplet&lt;Product, imageArray&gt;&gt;</code>.</p>
  
  <pre><code>let sizeDict  = totalResponseArray.flatMap { (obj) -&gt; [String:String] in
          var storedItem = [String:String]()
          storedItem["\(obj.one.productID)"] = "\(obj.one.size)"
          return storedItem
      }
  </code></pre>
  
  <p>The other way I can think to do this is using a loop but I feel like there is a cleaner way to do it. </p>
  
  <p>I am trying to apply a flatmap function to an array not a dictionary. The result of the flatmap function should be a dictionary of <code>[String:String]</code>. </p>
  
  <p>Here is the result I am trying to get. Is there a better or cleaner way of doing it? I figured out that the above code doesn't make sense to get this same result as the code below. </p>
  
  <pre><code>var storedItem = [String:String]()
  
      for eachItem in totalResponseArray{
          storedItem["\(eachItem.one.productID)"] = "\(eachItem.one.color)"
      }
  </code></pre>
  
  <p>EDIT:
  It turns out that the loop is the best way and only way to do it. I am not trying to map the function. </p>