title: How are input parameters filled in javascript method chains?
body: <p>I am trying to really understand the details of how javascript works. During method chaining, sometimes one method returns to another method that has a named input parameter.</p>
  
  <p>For instance, in D3, the pattern looks like this: </p>
  
  <pre><code>d3.select("body").selectAll("p")
      .data(dataset)
      .enter()
      .append("p")
      .text(function(d) { return d; }); //what does this d refer to? How is it filled?
  </code></pre>
  
  <p>In jquery, the pattern looks like this: </p>
  
  <pre><code>$.ajax({
    ...
  })
    .done(function( data ) {  //what does this data refer to? How is it filled? 
  </code></pre>
  
  <p>I know from practical coding that the name of these input parameter can be anything. But where does the data that files the input parameter come from? Does it just refer to the data returned from the prior method in the chain? </p>