title: D3: passing object in style method is not working
body: <p>I am using D3 for the exercise. However, I am having trouble passing an object to the <code>.style()</code> method:</p>
  
  <pre><code>var myStyles = [
    '#268BD2',
    '#BD3613',
    '#D11C24',
    '#C61C6F',
    '#595AB7',
    '#2176C7'
  ];
  </code></pre>
  
  <p>This below piece of code is working</p>
  
  <pre><code>d3.selectAll('.item') 
    .data(myStyles)
    .style('background',function(d){return d});
  </code></pre>
  
  <p>But none of the below two code pieces are working</p>
  
  <pre><code>d3.selectAll('.item')
    .data(myStyles)
    .style({'background':function(d){return d}});
  
  d3.selectAll('.item')
    .data(myStyles)
    .style({'color':'white','background':function(d){return d}});
  </code></pre>
  
  <p>Please explain what is wrong here.</p>