title: Trying to understand D3's selection.data() works
body: <p>I have as my HTML this:</p>
  
  <pre><code>&lt;div&gt;1&lt;/div&gt;
  &lt;div&gt;10&lt;/div&gt;
  </code></pre>
  
  <p>My JS:</p>
  
  <pre><code>divs = d3.select("body").selectAll("div");
  alert(divs[0].length);
  
  divs = divs.data([2]);
  alert(divs[0].length);
  </code></pre>
  
  <p>My js fiddle:</p>
  
  <p><a href="http://jsfiddle.net/p2v3B/" rel="nofollow">http://jsfiddle.net/p2v3B/</a></p>
  
  <p>D3's documentation - <a href="https://github.com/mbostock/d3/wiki/Selections#wiki-data" rel="nofollow">https://github.com/mbostock/d3/wiki/Selections#wiki-data</a> - suggests that selection.data() "joins the specified array of data with the current selection" however this test would seem to suggest it's not joining anything but rather flat out replacing it.</p>
  
  <p>ie. there's two divs and then after doing data() there's just one?</p>