Update April 2014: It occurred to me the other day that the magic mentioned below is unneeded, as map already provides the column indexes as the second argument. I've updated the gist so the following remark is no longer relevant. The most magical bit here is to use
Object.keys()
on the
first row of the array which yields an array of column indexes, which
we can then use map()
on to extract each column in turn.
Love to see a terser implementation if you've found one.