analytics.js
function pick(props, object) {
  if (!existy(object) || !isObject(object)) {
    return {};
  }

  if (isString(props)) {
    props = [props];
  }

  if (!isArray(props)) {
    props = [];
  }

  var result = {};

  for (var i = 0; i < props.length; i += 1) {
    if (isString(props[i]) && props[i] in object) {
      result[props[i]] = object[props[i]];
    }
  }

  return result;
}
function pick(props, object) {
  if (!existy(object) || !isObject(object)) {
    return {};
  }

  if (isString(props)) {
    props = [props];
  }

  if (!isArray(props)) {
    props = [];
  }

  var result = {};

  for (var i = 0; i < props.length; i += 1) {
    if (isString(props[i]) && props[i] in object) {
      result[props[i]] = object[props[i]];
    }
  }

  return result;
}
function pick ( props , object ) { if ( ! existy ( object ) || ! isObject ( object ) ) { return { } ; } if ( isString ( props ) ) { props = [ props ] ; } if ( ! isArray ( props ) ) { props = [ ] ; } var result = { } ; for ( var i = 0 ; i < props . length ; i += 1 ) { if ( isString ( props [ i ] ) && props [ i ] in object ) { result [ props [ i ] ] = object [ props [ i ] ] ; } } return result ; }
Returns a copy of the new `object` containing only the specified properties.

@name pick
@api public
@category Object
@see {@link omit}
@param {Array.<string>|string} props The property or properties to keep.
@param {Object} object The object to iterate over.
@return {Object} A new object containing only the specified properties from `object`.
@example
var person = { name: 'Tim', occupation: 'enchanter', fears: 'rabbits' };

pick('name', person);
//=> { name: 'Tim' }

pick(['name', 'fears'], person);
//=> { name: 'Tim', fears: 'rabbits' }
Returns a copy of the new object containing only the specified properties .