A convenient version of what is perhaps the most common use-case for map: extracting a list of property values.
很方便的为你提供一个获取列表值的方法
1 var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}]; 2 _.pluck(stooges, 'name'); 3 => ["moe", "larry", "curly"]
源码:
1 _.pluck = function(obj, key) { 2 return _.map(obj, function(value){ return value[key]; }); 3 };