MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / at

Function at

MathBox/mathbox-bundle.js:38073–38084  ·  view source on GitHub ↗

* Creates an array of elements from the specified indexes, or keys, of the * `collection`. Indexes may be specified as individual arguments or as arrays * of indexes. * * @static * @memberOf _ * @category Collections * @param {Array|Object|string} collection The co

(collection)

Source from the content-addressed store, hash-verified

38071 * // => ['fred', 'pebbles']
38072 */
38073 function at(collection) {
38074 var args = arguments,
38075 index = -1,
38076 props = baseFlatten(args, true, false, 1),
38077 length = (args[2] && args[2][args[1]] === collection) ? 1 : props.length,
38078 result = Array(length);
38079
38080 while(++index < length) {
38081 result[index] = collection[props[index]];
38082 }
38083 return result;
38084 }
38085
38086 /**
38087 * Checks if a given value is present in a collection using strict equality

Callers

nothing calls this directly

Calls 1

baseFlattenFunction · 0.85

Tested by

no test coverage detected