title: What does Javascript Arrow function with object as parameter mean?
body: <p>I was learning ReactJS here:
  <a href="https://egghead.io/lessons/react-dynamically-generated-components" rel="nofollow noreferrer">https://egghead.io/lessons/react-dynamically-generated-components</a> and came across this code snippet:</p>
  
  <pre><code>componentWillMount(){
      fetch( 'http://swapi.co/api/people/?format=json')
          .then( response =&gt; response.json() )
          .then( ({results: items}) =&gt; this.setState({items}) )
  }
  </code></pre>
  
  <p>What does the <code>({results: items})</code> part of the arrow function mean?</p>
  
  <p>I've seen arrow function</p>
  
  <ul>
  <li>with no parameter <code>()=&gt;console.log('hi')</code></li>
  <li>without parenthesis <code>word=&gt;console.log(word)</code></li>
  <li>and with multiple parameter seperated by comma <code>(one, two)=&gt;console.log(one)</code></li>
  </ul>
  
  <p>But never an object literal in this way. </p>
  
  <p>Also, why does <code>this.setState({items})</code> need curly braces around <code>items</code>? What does it all mean?</p>