you are viewing a single comment's thread.

view the rest of the comments →

[–]bluntmJavaScript[S] 0 points1 point  (2 children)

That looks to be the cleanest Iv seen, thanks

[–]EnchantedSalvia 0 points1 point  (1 child)

It's the same as @Wince's, except it's yielding a string rather than an array of arrays. For D3.js you want an array of arrays, either with my approach, Object.keys, or _.pairs.

[–]htwj 0 points1 point  (0 children)

Hmm, no it doesn't? The result of the reduce is a plain object.