3 ms·
Any links to your work with arrow functions and d3?
by djtriptych 12y ago
Any links to your work with arrow functions and d3?
- eric_bullington 12y agoI've only started using ES6 in anger over the past few weeks, so I don't have anything public at this time. However, if you're familiar with d3 at all, then you know this pattern well: someSelection .attr("r", function(d, i) { return i * 20; }) Well, with ES6, this becomes so much nicer to write: someSelection .attr('r', (d, i) => i * 20) Nothing earth-shattering, but when you're writing dozens of these accessor functions in each function, it makes d3 much easier to work with.