title: Javascript ES6 spread operator on undefined
body: <p>While developing my react App, I needed to send a conditional prop to a component so I found somewhere a pattern to do so, although it seems really weird to me and I couldn't understand how and why it worked.</p>
  
  <p>If I type: </p>
  
  <pre><code>console.log(...undefined)   // Error 
  console.log([...undefined]) // Error
  console.log({...undefined}) // Work
  </code></pre>
  
  <p>When the spread operator is activated on undefined an error is raised, although when the undefined is inside an object, an empty object returned.</p>
  
  <p>I'm quite surprised regarding this behavior, is that really how it supposed to be, can I rely on this and is that a good practice?</p>