title: how does Array.from with map produce key
body: <p>I'm confused about where the value of 'key' is coming from. When I console.log the contactsList each object in the array has a key</p>
  
  <p>When I generate  contactsOnly (by returning each element in the map) I just get an array of contacts without any keys.</p>
  
  <p>If I then call addKeys(contactsOnly) I end up with an OBJECT, not an array and the objects are numbered. With key being undefined.</p>
  
  <p>Is the index from the map function somehow being passed to addKeys?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const firstNames = ['Emma','Noah','Olivia','Liam','Ava','William','Sophia']
  const lastNames = ['Smith','Jones','Brown','Johnson','Williams']
  
  // generate a random number between min and max
  const rand = (max, min = 0) =&gt; Math.floor(Math.random() * (max - min + 1)) + min
  
  // generate a name
  const generateName = () =&gt; `${firstNames[rand(firstNames.length - 1)]} ${lastNames[rand(lastNames.length - 1)]}`
  
  // generate a phone number
  const generatePhoneNumber = () =&gt; `${rand(999, 100)}-${rand(999, 100)}-${rand(9999, 1000)}`
  
  
  // create a person
  const createContact = () =&gt; ({name: generateName(),
                               phone: generatePhoneNumber()})
  
  // add keys to based on index
  const addKeys = (val, key) =&gt; ({key, ...val})
  
  // create an array of length NUM_CONTACTS 
  const contactList = Array.from({length: 5}, createContact).map(addKeys)
  console.log(contactList)
  
  const contactsOnly = Array.from({length: 5}, createContact).map(i=&gt;i)
  console.log(contactsOnly)
  
  const contactsAdded =addKeys(contactsOnly)
  console.log(contactsAdded)</code></pre>
  </div>
  </div>
  </p>