title: Javascript - function argument
body: <p>I am learning Javascript, and bit confused the below usage. These question may be more javaScript than d3 specific.</p>
  
  <p><a href="http://mbostock.github.com/d3/ex/sunburst.html" rel="nofollow">http://mbostock.github.com/d3/ex/sunburst.html</a></p>
  
  <pre><code>var arc = d3.svg.arc()
  .startAngle(function(d) { return d.x; })
  .endAngle(function(d) { return d.x + d.dx; })
  .innerRadius(function(d) { return Math.sqrt(d.y); })
  .outerRadius(function(d) { return Math.sqrt(d.y + d.dy); });
  </code></pre>
  
  <p>so,</p>
  
  <ol>
  <li>startAngle, endAngle etc takes a function as argument. What is the rationale being the argument a function rather than just a number?</li>
  <li>In the full code, no where "d" is defined.I see it in almost all of d3 programs. What is "d" for? How is it set or where is it passed?</li>
  </ol>
  
  <p>thanks.</p>