The main takeaway is that, using.each()you get access to 3 things you need:d,thisandi. With.forEach(), on an array (like in the example from the beginning) you only get 2 things (dandi), and you'd have to do a bunch of work to also associate an HTML element with those 2 things. And that, among other things, is how d3 is useful.
http://stackoverflow.com/questions/13465796/d3-javascript-difference-between-foreach-and-each
No comments:
Post a Comment