O'Reilly logo
  • John Muntges thinks this is interesting:

function render(dataToRender) { var selector = d3.select('body') .selectAll('div') .data(dataToRender); var entering = selector.enter(); entering.append('div') .text(function(d) { return d; }); selector.text(function(d) { return d; }); var exiting = selector.exit(); exiting.remove();

From

Cover of D3.js By Example

Note

Code Error:
Last line of function is missing. The missing line is:
selector.text(function(d) { return d; });