Retrieves the value of a specified property from all elements in the `collection`.

@static
@memberOf _
@type Function
@category Collections
@param {Array|Object|string} collection The collection to iterate over.
@param {string} property The property to pluck.
@returns {Array} Returns a new array of property values.
@example

var stooges = [
{ 'name': 'moe', 'age': 40 },
{ 'name': 'larry', 'age': 50 }
];

_.pluck(stooges, 'name');
// => ['moe', 'larry']
function pluck(collection, property) {
      var index = -1,
          length = collection ? collection.length : 0;

      if (typeof length == 'number') {
        var result = Array(length);
        while (++index < length) {
          result[index] = collection[index][property];
        }
      }
      return result || map(collection, property);
    }