updated to use Array.forEach instead of for (... in ...) to avoid issues with prototypes (and avoiding explicit hasOwnProperty)

https://github.com/mbostock/d3/wiki/Arrays
(d3 automatically provides a shim for Array.forEach in browsers that have yet to implement it)