title: Does the spread operator not copy over the prototype?
body: <p>The following code does not appear to copy over an object's prototype.</p>
  <pre><code>const animalProto = {
   eat() {
    // function body
   },
  
   sleep() {
    // function body
   },
  }
  
  function animalCreator(proto, attributes) {
   return {...Object.create(proto), ...attributes}
  }
  
  const cat = animalCreator(animalProto, { name: 'garfield' })
  
  cat.eat() // this is an error; function is not defined; it doesn't appear to link the prototype chain.
  </code></pre>
  <p>If I replace the spread with the following it works:</p>
  <pre><code>return Object.assign(Object.create(proto), attributes)
  </code></pre>
  <p>Essentially my question is why does <code>Object.assign</code> work but not the spread operator. Is there something <code>Object.assign</code> is doing that the spread operator is missing?</p>