If I need to extract property values, I like to use a pattern looking like this: arr.map(prop('name')). In this case our array (arr, matey) contains a bunch of objects names of which we want to extract. I've defined a helper, prop, for this purpose. prop is just a factory that returns a function that extracts the value. Consider the example implementation below:
function prop(name) { return function(o) { return o[name]; }; }Who says factories are useful only in Java? :)
If you are using Underscore, you may find the pluck method useful. It does effectively the same thing.