build/rekord.js
function(values, keys)
  {
    var valuesResolver = createPropertyResolver( values );

    if ( keys )
    {
      var keysResolver = createPropertyResolver( keys );
      var result = {};

      for (var i = 0; i < this.length; i++)
      {
        var model = this[ i ];
        var value = valuesResolver( model );
        var key = keysResolver( model );

        result[ key ] = value;
      }

      return result;
    }
    else
    {
      var result = [];

      for (var i = 0; i < this.length; i++)
      {
        var model = this[ i ];
        var value = valuesResolver( model );

        result.push( value );
      }

      return result;
    }
  }
function(values, keys)
  {
    var valuesResolver = createPropertyResolver( values );

    if ( keys )
    {
      var keysResolver = createPropertyResolver( keys );
      var result = {};

      for (var i = 0; i < this.length; i++)
      {
        var model = this[ i ];
        var value = valuesResolver( model );
        var key = keysResolver( model );

        result[ key ] = value;
      }

      return result;
    }
    else
    {
      var result = [];

      for (var i = 0; i < this.length; i++)
      {
        var model = this[ i ];
        var value = valuesResolver( model );

        result.push( value );
      }

      return result;
    }
  }
function ( values , keys ) { var valuesResolver = createPropertyResolver ( values ) ; if ( keys ) { var keysResolver = createPropertyResolver ( keys ) ; var result = { } ; for ( var i = 0 ; i < this . length ; i ++ ) { var model = this [ i ] ; var value = valuesResolver ( model ) ; var key = keysResolver ( model ) ; result [ key ] = value ; } return result ; } else { var result = [ ] ; for ( var i = 0 ; i < this . length ; i ++ ) { var model = this [ i ] ; var value = valuesResolver ( model ) ; result . push ( value ) ; } return result ; } }
Plucks values from elements in the collection. If only a `values` property
expression is given the result will be an array of resolved values. If the
`keys` property expression is given, the result will be an object where the
property of the object is determined by the key expression.

```javascript
var c = Rekord.collect([{age: 2, nm: 'T'}, {age: 4, nm: 'R'}, {age: 5, nm: 'G'}]);
c.pluck(); // c
c.pluck('age'); // [2, 4, 5]
c.pluck('age', 'nm'); // {T: e, R: 4, G: 5}
c.pluck(null, 'nm'); // {T: {age: 2, nm: 'T'}, R: {age: 4, nm: 'R'}, G: {age: 5, nm: 'G'}}
c.pluck('{age}-{nm}'); // ['2-T', '4-R', '5-G']
```

@method
@memberof Rekord.Collection#
@param {propertyResolverInput} [values] -
The expression which converts an element into a value to pluck.
@param {propertyResolverInput} [keys] -
The expression which converts an element into an object property (key).
@return {Array|Object} -
The plucked values.
@see Rekord.createPropertyResolver
Plucks values from elements in the collection . If only a values property expression is given the result will be an array of resolved values . If the keys property expression is given the result will be an object where the property of the object is determined by the key expression .