title: d3 d => vs function(d)
body: <p>I am working  through this posting trying to get a d3 chart to come to life. Also reading other posts, so getting input from across the community.... 
  <a href="https://medium.com/@vaibhavkumar_19430/how-to-create-a-grouped-bar-chart-in-d3-js-232c54f85894" rel="nofollow noreferrer">https://medium.com/@vaibhavkumar_19430/how-to-create-a-grouped-bar-chart-in-d3-js-232c54f85894</a></p>
  
  <p>I see 2 different syntaxes used.</p>
  
  <p>The first is used below on the x attribute. I believe this is called 'fat arrow'
  The second is an inline function and is used on the Y attribute. </p>
  
  <pre><code>model_name.selectAll(".bar.field1")
    .data(d =&gt; [d])
    .enter()
    .append("rect")
    .attr("class", "bar field1")
  .style("fill","blue")
    .attr("x", d =&gt; xScale1('field1'))
    .attr("y", function(d) { return yScale(d.field1) })
  </code></pre>
  
  <p>Are these equivalent? </p>
  
  <p>Can the fat arrow only be used when the desired result can be produced w/ a single line?</p>
  
  <p>Can you use something like this (I cant make it work)</p>
  
  <pre><code>  .attr("x", d =&gt;{ stmt1;  stmt2;  etc;  return d*5; }
  </code></pre>
  
  <p>Does fat arrow offer some great benefit such that it should be considered in a 1 line result  case?  </p>