1 var isIndex = require('./isIndex'),
2 isLength = require('./isLength');
5 * The base implementation of `_.at` without support for string collections
6 * and individual key arguments.
9 * @param {Array|Object} collection The collection to iterate over.
10 * @param {number[]|string[]} props The property names or indexes of elements to pick.
11 * @returns {Array} Returns the new array of picked elements.
13 function baseAt(collection, props) {
15 length = collection.length,
16 isArr = isLength(length),
17 propsLength = props.length,
18 result = Array(propsLength);
20 while(++index < propsLength) {
21 var key = props[index];
23 result[index] = isIndex(key, length) ? collection[key] : undefined;
25 result[index] = collection[key];
31 module.exports = baseAt;