4 ms·
I'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 yo
by eric_bullington 12y ago
I'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.