Q:

Getting all the values for a given key, in an array of objects, using JavaScript and/or D3.js

I'm building a dashboard that uses D3.js for charts.  I have a large array of objects.  Each object has 32 key value pairs, with the same keys.  Doesn't anyone know a good way to get all the values for a given key?
EDIT:
As soon as I asked the question a simple function came to me.  Also thought maybe a function already existed that I wasn't finding.
function getValues(data, key){
  var values = [];

  data.forEach(function(d){
    var v = d[key];

    if(!d3.set(values).has(v)){
      values.push(v);
    }
  })

  return values;
}

A:

If you're already using d3, take a look at Mike Bostock's "Underscore Equivalents" gist: https://gist.github.com/mbostock/3934356
So
data.map(function(d) { return d[key]; });

will get you all the values. If you only want unique values, use 
d3.set(data.map(function(d) { return d[key]; })).values());

A:

I have to create a lot of dashboards using D3 as well. Another option for you which I utilize a lot is underscore.js. It saves me time, and for my needs helps condense code. There is a function called 'pluck' in underscore, which does exactly what you asked for. For an array of objects, you can declare a key and it will return all values.
Example:
var data = [{name: 'dan', value: 40}, {name: 'ryan', value: 50}];
var getKeys = _.pluck(data, 'name');
=> ["dan", "ryan"]

http://underscorejs.org/#pluck

