The *Control Freak* SDK provides a general purpose API dealing with arrays, numbers and strings. This API is implemented
by lodash Lodash
## `Array`
* `_.chunk`
* `_.compact`
* `_.difference`
* `_.drop`
* `_.dropRight`
* `_.dropRightWhile`
* `_.dropWhile`
* `_.fill`
* `_.findIndex`
* `_.findLastIndex`
* `_.first`
* `_.flatten`
* `_.flattenDeep`
* `_.head` -> `first`
* `_.indexOf`
* `_.initial`
* `_.intersection`
* `_.last`
* `_.lastIndexOf`
* `_.object` -> `zipObject`
* `_.pull`
* `_.pullAt`
* `_.remove`
* `_.rest`
* `_.slice`
* `_.sortedIndex`
* `_.sortedLastIndex`
* `_.tail` -> `rest`
* `_.take`
* `_.takeRight`
* `_.takeRightWhile`
* `_.takeWhile`
* `_.union`
* `_.uniq`
* `_.unique` -> `uniq`
* `_.unzip`
* `_.without`
* `_.xor`
* `_.zip`
* `_.zipObject`
## `Chain`
* `_`
* `_.chain`
* `_.tap`
* `_.thru`
* `_.prototype.chain`
* `_.prototype.commit`
* `_.prototype.plant`
* `_.prototype.reverse`
* `_.prototype.run` -> `value`
* `_.prototype.toJSON` -> `value`
* `_.prototype.toString`
* `_.prototype.value`
* `_.prototype.valueOf` -> `value`
## `Collection`
* `_.all` -> `every`
* `_.any` -> `some`
* `_.at`
* `_.collect` -> `map`
* `_.contains` -> `includes`
* `_.countBy`
* `_.detect` -> `find`
* `_.each` -> `forEach`
* `_.eachRight` -> `forEachRight`
* `_.every`
* `_.filter`
* `_.find`
* `_.findLast`
* `_.findWhere`
* `_.foldl` -> `reduce`
* `_.foldr` -> `reduceRight`
* `_.forEach`
* `_.forEachRight`
* `_.groupBy`
* `_.include` -> `includes`
* `_.includes`
* `_.indexBy`
* `_.inject` -> `reduce`
* `_.invoke`
* `_.map`
* `_.partition`
* `_.pluck`
* `_.reduce`
* `_.reduceRight`
* `_.reject`
* `_.sample`
* `_.select` -> `filter`
* `_.shuffle`
* `_.size`
* `_.some`
* `_.sortBy`
* `_.sortByAll`
* `_.sortByOrder`
* `_.where`
## `Date`
* `_.now`
## `Function`
* `_.after`
* `_.ary`
* `_.backflow` -> `flowRight`
* `_.before`
* `_.bind`
* `_.bindAll`
* `_.bindKey`
* `_.compose` -> `flowRight`
* `_.curry`
* `_.curryRight`
* `_.debounce`
* `_.defer`
* `_.delay`
* `_.flow`
* `_.flowRight`
* `_.memoize`
* `_.negate`
* `_.once`
* `_.partial`
* `_.partialRight`
* `_.rearg`
* `_.restParam`
* `_.spread`
* `_.throttle`
* `_.wrap`
## `Lang`
* `_.clone`
* `_.cloneDeep`
* `_.isArguments`
* `_.isArray`
* `_.isBoolean`
* `_.isDate`
* `_.isElement`
* `_.isEmpty`
* `_.isEqual`
* `_.isError`
* `_.isFinite`
* `_.isFunction`
* `_.isMatch`
* `_.isNaN`
* `_.isNative`
* `_.isNull`
* `_.isNumber`
* `_.isObject`
* `_.isPlainObject`
* `_.isRegExp`
* `_.isString`
* `_.isTypedArray`
* `_.isUndefined`
* `_.toArray`
* `_.toPlainObject`
## `Math`
* `_.add`
* `_.max`
* `_.min`
* `_.sum`
## `Number`
* `_.inRange`
* `_.random`
## `Object`
* `_.assign`
* `_.create`
* `_.defaults`
* `_.extend` -> `assign`
* `_.findKey`
* `_.findLastKey`
* `_.forIn`
* `_.forInRight`
* `_.forOwn`
* `_.forOwnRight`
* `_.functions`
* `_.has`
* `_.invert`
* `_.keys`
* `_.keysIn`
* `_.mapValues`
* `_.merge`
* `_.methods` -> `functions`
* `_.omit`
* `_.pairs`
* `_.pick`
* `_.result`
* `_.transform`
* `_.values`
* `_.valuesIn`
## `String`
* `_.camelCase`
* `_.capitalize`
* `_.deburr`
* `_.endsWith`
* `_.escape`
* `_.escapeRegExp`
* `_.kebabCase`
* `_.pad`
* `_.padLeft`
* `_.padRight`
* `_.parseInt`
* `_.repeat`
* `_.snakeCase`
* `_.startCase`
* `_.startsWith`
* `_.template`
* `_.trim`
* `_.trimLeft`
* `_.trimRight`
* `_.trunc`
* `_.unescape`
* `_.words`
## `Utility`
* `_.attempt`
* `_.callback`
* `_.constant`
* `_.identity`
* `_.iteratee` -> `callback`
* `_.matches`
* `_.matchesProperty`
* `_.mixin`
* `_.noConflict`
* `_.noop`
* `_.property`
* `_.propertyOf`
* `_.range`
* `_.runInContext`
* `_.times`
* `_.uniqueId`
## `Methods`
* `_.templateSettings.imports._`
## `Properties`
* `_.VERSION`
* `_.support`
* `_.support.argsTag`
* `_.support.enumErrorProps`
* `_.support.enumPrototypes`
* `_.support.funcDecomp`
* `_.support.funcNames`
* `_.support.nodeTag`
* `_.support.nonEnumShadows`
* `_.support.nonEnumStrings`
* `_.support.ownLast`
* `_.support.spliceObjects`
* `_.support.unindexedChars`
* `_.templateSettings`
* `_.templateSettings.escape`
* `_.templateSettings.evaluate`
* `_.templateSettings.imports`
* `_.templateSettings.interpolate`
* `_.templateSettings.variable`
## `“Array” Methods`
### `_.chunk(array, [size=1])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4536 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package")
Creates an array of elements split into groups the length of `size`.
If `collection` can't be split evenly, the final chunk will be the remaining
elements.
#### Arguments
1. `array` *(Array)*: The array to process.
2. `[size=1]` *(number)*: The length of each chunk.
#### Returns
*(Array)*: Returns the new array containing chunks.
#### Example
```js
_.chunk(['a', 'b', 'c', 'd'], 2);
// => [['a', 'b'], ['c', 'd']]
_.chunk(['a', 'b', 'c', 'd'], 3);
// => [['a', 'b', 'c'], ['d']]
```
* * *
### `_.compact(array)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4567 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package")
Creates an array with all falsey values removed. The values `false`, `null`,
`0`, `""`, `undefined`, and `NaN` are falsey.
#### Arguments
1. `array` *(Array)*: The array to compact.
#### Returns
*(Array)*: Returns the new array of filtered values.
#### Example
```js
_.compact([0, 1, false, 2, '', 3]);
// => [1, 2, 3]
```
* * *
### `_.difference(array, [values])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4602 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package")
Creates an array excluding all values of the provided arrays using
`SameValueZero` for equality comparisons.
**Note:** `SameValueZero` comparisons are like strict equality comparisons,
e.g. `===`, except that `NaN` matches `NaN`. See the
[ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
for more details.
#### Arguments
1. `array` *(Array)*: The array to inspect.
2. `[values]` *(...Array)*: The arrays of values to exclude.
#### Returns
*(Array)*: Returns the new array of filtered values.
#### Example
```js
_.difference([1, 2, 3], [4, 2]);
// => [1, 3]
```
* * *
### `_.drop(array, [n=1])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4632 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package")
Creates a slice of `array` with `n` elements dropped from the beginning.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[n=1]` *(number)*: The number of elements to drop.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.drop([1, 2, 3]);
// => [2, 3]
_.drop([1, 2, 3], 2);
// => [3]
_.drop([1, 2, 3], 5);
// => []
_.drop([1, 2, 3], 0);
// => [1, 2, 3]
```
* * *
### `_.dropRight(array, [n=1])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4667 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package")
Creates a slice of `array` with `n` elements dropped from the end.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[n=1]` *(number)*: The number of elements to drop.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.dropRight([1, 2, 3]);
// => [1, 2]
_.dropRight([1, 2, 3], 2);
// => [1]
_.dropRight([1, 2, 3], 5);
// => []
_.dropRight([1, 2, 3], 0);
// => [1, 2, 3]
```
* * *
### `_.dropRightWhile(array, [predicate=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4728 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package")
Creates a slice of `array` excluding elements dropped from the end.
Elements are dropped until `predicate` returns falsey. The predicate is
bound to `thisArg` and invoked with three arguments: (value, index, array).
If a property name is provided for `predicate` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `predicate` the created `_.matches` style
callback returns `true` for elements that match the properties of the given
object, else `false`.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
3. `[thisArg]` *(*)*: The `this` binding of `predicate`.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.dropRightWhile([1, 2, 3], function(n) {
return n > 1;
});
// => [1]
var users = [
{ 'user': 'barney', 'active': true },
{ 'user': 'fred', 'active': false },
{ 'user': 'pebbles', 'active': false }
];
// using the `_.matches` callback shorthand
_.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
// => ['barney', 'fred']
// using the `_.matchesProperty` callback shorthand
_.pluck(_.dropRightWhile(users, 'active', false), 'user');
// => ['barney']
// using the `_.property` callback shorthand
_.pluck(_.dropRightWhile(users, 'active'), 'user');
// => ['barney', 'fred', 'pebbles']
```
* * *
### `_.dropWhile(array, [predicate=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4783 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package")
Creates a slice of `array` excluding elements dropped from the beginning.
Elements are dropped until `predicate` returns falsey. The predicate is
bound to `thisArg` and invoked with three arguments: (value, index, array).
If a property name is provided for `predicate` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `predicate` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
3. `[thisArg]` *(*)*: The `this` binding of `predicate`.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.dropWhile([1, 2, 3], function(n) {
return n < 3;
});
// => [3]
var users = [
{ 'user': 'barney', 'active': false },
{ 'user': 'fred', 'active': false },
{ 'user': 'pebbles', 'active': true }
];
// using the `_.matches` callback shorthand
_.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
// => ['fred', 'pebbles']
// using the `_.matchesProperty` callback shorthand
_.pluck(_.dropWhile(users, 'active', false), 'user');
// => ['pebbles']
// using the `_.property` callback shorthand
_.pluck(_.dropWhile(users, 'active'), 'user');
// => ['barney', 'fred', 'pebbles']
```
* * *
### `_.fill(array, value, [start=0], [end=array.length])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4817 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package")
Fills elements of `array` with `value` from `start` up to, but not
including, `end`.
**Note:** This method mutates `array`.
#### Arguments
1. `array` *(Array)*: The array to fill.
2. `value` *(*)*: The value to fill `array` with.
3. `[start=0]` *(number)*: The start position.
4. `[end=array.length]` *(number)*: The end position.
#### Returns
*(Array)*: Returns `array`.
#### Example
```js
var array = [1, 2, 3];
_.fill(array, 'a');
console.log(array);
// => ['a', 'a', 'a']
_.fill(Array(3), 2);
// => [2, 2, 2]
_.fill([4, 6, 8], '*', 1, 2);
// => [4, '*', 8]
```
* * *
### `_.findIndex(array, [predicate=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4877 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package")
This method is like `_.find` except that it returns the index of the first
element `predicate` returns truthy for instead of the element itself.
If a property name is provided for `predicate` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `predicate` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
#### Arguments
1. `array` *(Array)*: The array to search.
2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
3. `[thisArg]` *(*)*: The `this` binding of `predicate`.
#### Returns
*(number)*: Returns the index of the found element, else `-1`.
#### Example
```js
var users = [
{ 'user': 'barney', 'active': false },
{ 'user': 'fred', 'active': false },
{ 'user': 'pebbles', 'active': true }
];
_.findIndex(users, function(chr) {
return chr.user == 'barney';
});
// => 0
// using the `_.matches` callback shorthand
_.findIndex(users, { 'user': 'fred', 'active': false });
// => 1
// using the `_.matchesProperty` callback shorthand
_.findIndex(users, 'active', false);
// => 0
// using the `_.property` callback shorthand
_.findIndex(users, 'active');
// => 2
```
* * *
### `_.findLastIndex(array, [predicate=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4927 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package")
This method is like `_.findIndex` except that it iterates over elements
of `collection` from right to left.
If a property name is provided for `predicate` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `predicate` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
#### Arguments
1. `array` *(Array)*: The array to search.
2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
3. `[thisArg]` *(*)*: The `this` binding of `predicate`.
#### Returns
*(number)*: Returns the index of the found element, else `-1`.
#### Example
```js
var users = [
{ 'user': 'barney', 'active': true },
{ 'user': 'fred', 'active': false },
{ 'user': 'pebbles', 'active': false }
];
_.findLastIndex(users, function(chr) {
return chr.user == 'pebbles';
});
// => 2
// using the `_.matches` callback shorthand
_.findLastIndex(users, { 'user': 'barney', 'active': true });
// => 0
// using the `_.matchesProperty` callback shorthand
_.findLastIndex(users, 'active', false);
// => 2
// using the `_.property` callback shorthand
_.findLastIndex(users, 'active');
// => 0
```
* * *
### `_.first(array)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4946 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.first "See the npm package")
Gets the first element of `array`.
#### Aliases
*_.head*
#### Arguments
1. `array` *(Array)*: The array to query.
#### Returns
*(*)*: Returns the first element of `array`.
#### Example
```js
_.first([1, 2, 3]);
// => 1
_.first([]);
// => undefined
```
* * *
### `_.flatten(array, [isDeep])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4970 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package")
Flattens a nested array. If `isDeep` is `true` the array is recursively
flattened, otherwise it is only flattened a single level.
#### Arguments
1. `array` *(Array)*: The array to flatten.
2. `[isDeep]` *(boolean)*: Specify a deep flatten.
#### Returns
*(Array)*: Returns the new flattened array.
#### Example
```js
_.flatten([1, [2, 3, [4]]]);
// => [1, 2, 3, [4]]
// using `isDeep`
_.flatten([1, [2, 3, [4]]], true);
// => [1, 2, 3, 4]
```
* * *
### `_.flattenDeep(array)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L4991 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package")
Recursively flattens a nested array.
#### Arguments
1. `array` *(Array)*: The array to recursively flatten.
#### Returns
*(Array)*: Returns the new flattened array.
#### Example
```js
_.flattenDeep([1, [2, 3, [4]]]);
// => [1, 2, 3, 4]
```
* * *
### `_.indexOf(array, value, [fromIndex=0])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5028 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package")
Gets the index at which the first occurrence of `value` is found in `array`
using `SameValueZero` for equality comparisons. If `fromIndex` is negative,
it is used as the offset from the end of `array`. If `array` is sorted
providing `true` for `fromIndex` performs a faster binary search.
**Note:** `SameValueZero` comparisons are like strict equality comparisons,
e.g. `===`, except that `NaN` matches `NaN`. See the
[ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
for more details.
#### Arguments
1. `array` *(Array)*: The array to search.
2. `value` *(*)*: The value to search for.
3. `[fromIndex=0]` *(boolean|number)*: The index to search from or `true` to perform a binary search on a sorted array.
#### Returns
*(number)*: Returns the index of the matched value, else `-1`.
#### Example
```js
_.indexOf([1, 2, 1, 2], 2);
// => 1
// using `fromIndex`
_.indexOf([1, 2, 1, 2], 2, 2);
// => 3
// performing a binary search
_.indexOf([1, 1, 2, 2], 2, true);
// => 2
```
* * *
### `_.initial(array)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package")
Gets all but the last element of `array`.
#### Arguments
1. `array` *(Array)*: The array to query.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.initial([1, 2, 3]);
// => [1, 2]
```
* * *
### `_.intersection([arrays])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5082 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package")
Creates an array of unique values in all provided arrays using `SameValueZero`
for equality comparisons.
**Note:** `SameValueZero` comparisons are like strict equality comparisons,
e.g. `===`, except that `NaN` matches `NaN`. See the
[ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
for more details.
#### Arguments
1. `[arrays]` *(...Array)*: The arrays to inspect.
#### Returns
*(Array)*: Returns the new array of shared values.
#### Example
```js
_.intersection([1, 2], [4, 2], [2, 1]);
// => [2]
```
* * *
### `_.last(array)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5137 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package")
Gets the last element of `array`.
#### Arguments
1. `array` *(Array)*: The array to query.
#### Returns
*(*)*: Returns the last element of `array`.
#### Example
```js
_.last([1, 2, 3]);
// => 3
```
* * *
### `_.lastIndexOf(array, value, [fromIndex=array.length-1])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5167 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package")
This method is like `_.indexOf` except that it iterates over elements of
`array` from right to left.
#### Arguments
1. `array` *(Array)*: The array to search.
2. `value` *(*)*: The value to search for.
3. `[fromIndex=array.length-1]` *(boolean|number)*: The index to search from or `true` to perform a binary search on a sorted array.
#### Returns
*(number)*: Returns the index of the matched value, else `-1`.
#### Example
```js
_.lastIndexOf([1, 2, 1, 2], 2);
// => 3
// using `fromIndex`
_.lastIndexOf([1, 2, 1, 2], 2, 2);
// => 1
// performing a binary search
_.lastIndexOf([1, 1, 2, 2], 2, true);
// => 3
```
* * *
### `_.pull(array, [values])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5218 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package")
Removes all provided values from `array` using `SameValueZero` for equality
comparisons.
**Notes:**
* Unlike `_.without`, this method mutates `array`.
* `SameValueZero` comparisons are like strict equality comparisons, e.g. `===`,
except that `NaN` matches `NaN`. See the [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
for more details.
#### Arguments
1. `array` *(Array)*: The array to modify.
2. `[values]` *(...*)*: The values to remove.
#### Returns
*(Array)*: Returns `array`.
#### Example
```js
var array = [1, 2, 3, 1, 2, 3];
_.pull(array, 2, 3);
console.log(array);
// => [1, 1]
```
* * *
### `_.pullAt(array, [indexes])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5265 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package")
Removes elements from `array` corresponding to the given indexes and returns
an array of the removed elements. Indexes may be specified as an array of
indexes or as individual arguments.
**Note:** Unlike `_.at`, this method mutates `array`.
#### Arguments
1. `array` *(Array)*: The array to modify.
2. `[indexes]` *(...(number|number[])*: The indexes of elements to remove, specified as individual indexes or arrays of indexes.
#### Returns
*(Array)*: Returns the new array of removed elements.
#### Example
```js
var array = [5, 10, 15, 20];
var evens = _.pullAt(array, 1, 3);
console.log(array);
// => [5, 15]
console.log(evens);
// => [10, 20]
```
* * *
### `_.remove(array, [predicate=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5322 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package")
Removes all elements from `array` that `predicate` returns truthy for
and returns an array of the removed elements. The predicate is bound to
`thisArg` and invoked with three arguments: (value, index, array).
If a property name is provided for `predicate` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `predicate` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
**Note:** Unlike `_.filter`, this method mutates `array`.
#### Arguments
1. `array` *(Array)*: The array to modify.
2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
3. `[thisArg]` *(*)*: The `this` binding of `predicate`.
#### Returns
*(Array)*: Returns the new array of removed elements.
#### Example
```js
var array = [1, 2, 3, 4];
var evens = _.remove(array, function(n) {
return n % 2 == 0;
});
console.log(array);
// => [1, 3]
console.log(evens);
// => [2, 4]
```
* * *
### `_.rest(array)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5353 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package")
Gets all but the first element of `array`.
#### Aliases
*_.tail*
#### Arguments
1. `array` *(Array)*: The array to query.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.rest([1, 2, 3]);
// => [2, 3]
```
* * *
### `_.slice(array, [start=0], [end=array.length])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5371 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package")
Creates a slice of `array` from `start` up to, but not including, `end`.
**Note:** This function is used instead of `Array#slice` to support node
lists in IE < 9 and to ensure dense arrays are returned.
#### Arguments
1. `array` *(Array)*: The array to slice.
2. `[start=0]` *(number)*: The start position.
3. `[end=array.length]` *(number)*: The end position.
#### Returns
*(Array)*: Returns the slice of `array`.
* * *
### `_.sortedIndex(array, value, [iteratee=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package")
Uses a binary search to determine the lowest index at which `value` should
be inserted into `array` in order to maintain its sort order. If an iteratee
function is provided it is invoked for `value` and each element of `array`
to compute their sort ranking. The iteratee is bound to `thisArg` and
invoked with one argument; (value).
If a property name is provided for `iteratee` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `iteratee` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
#### Arguments
1. `array` *(Array)*: The sorted array to inspect.
2. `value` *(*)*: The value to evaluate.
3. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
4. `[thisArg]` *(*)*: The `this` binding of `iteratee`.
#### Returns
*(number)*: Returns the index at which `value` should be inserted
into `array`.
#### Example
```js
_.sortedIndex([30, 50], 40);
// => 1
_.sortedIndex([4, 4, 5, 5], 5);
// => 2
var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
// using an iteratee function
_.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
return this.data[word];
}, dict);
// => 1
// using the `_.property` callback shorthand
_.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
// => 1
```
* * *
### `_.sortedLastIndex(array, value, [iteratee=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5453 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package")
This method is like `_.sortedIndex` except that it returns the highest
index at which `value` should be inserted into `array` in order to
maintain its sort order.
#### Arguments
1. `array` *(Array)*: The sorted array to inspect.
2. `value` *(*)*: The value to evaluate.
3. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
4. `[thisArg]` *(*)*: The `this` binding of `iteratee`.
#### Returns
*(number)*: Returns the index at which `value` should be inserted
into `array`.
#### Example
```js
_.sortedLastIndex([4, 4, 5, 5], 5);
// => 4
```
* * *
### `_.take(array, [n=1])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5479 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package")
Creates a slice of `array` with `n` elements taken from the beginning.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[n=1]` *(number)*: The number of elements to take.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.take([1, 2, 3]);
// => [1]
_.take([1, 2, 3], 2);
// => [1, 2]
_.take([1, 2, 3], 5);
// => [1, 2, 3]
_.take([1, 2, 3], 0);
// => []
```
* * *
### `_.takeRight(array, [n=1])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5514 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package")
Creates a slice of `array` with `n` elements taken from the end.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[n=1]` *(number)*: The number of elements to take.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.takeRight([1, 2, 3]);
// => [3]
_.takeRight([1, 2, 3], 2);
// => [2, 3]
_.takeRight([1, 2, 3], 5);
// => [1, 2, 3]
_.takeRight([1, 2, 3], 0);
// => []
```
* * *
### `_.takeRightWhile(array, [predicate=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5575 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package")
Creates a slice of `array` with elements taken from the end. Elements are
taken until `predicate` returns falsey. The predicate is bound to `thisArg`
and invoked with three arguments: (value, index, array).
If a property name is provided for `predicate` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `predicate` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
3. `[thisArg]` *(*)*: The `this` binding of `predicate`.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.takeRightWhile([1, 2, 3], function(n) {
return n > 1;
});
// => [2, 3]
var users = [
{ 'user': 'barney', 'active': true },
{ 'user': 'fred', 'active': false },
{ 'user': 'pebbles', 'active': false }
];
// using the `_.matches` callback shorthand
_.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
// => ['pebbles']
// using the `_.matchesProperty` callback shorthand
_.pluck(_.takeRightWhile(users, 'active', false), 'user');
// => ['fred', 'pebbles']
// using the `_.property` callback shorthand
_.pluck(_.takeRightWhile(users, 'active'), 'user');
// => []
```
* * *
### `_.takeWhile(array, [predicate=_.identity], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package")
Creates a slice of `array` with elements taken from the beginning. Elements
are taken until `predicate` returns falsey. The predicate is bound to
`thisArg` and invoked with three arguments: (value, index, array).
If a property name is provided for `predicate` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `predicate` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
#### Arguments
1. `array` *(Array)*: The array to query.
2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
3. `[thisArg]` *(*)*: The `this` binding of `predicate`.
#### Returns
*(Array)*: Returns the slice of `array`.
#### Example
```js
_.takeWhile([1, 2, 3], function(n) {
return n < 3;
});
// => [1, 2]
var users = [
{ 'user': 'barney', 'active': false },
{ 'user': 'fred', 'active': false},
{ 'user': 'pebbles', 'active': true }
];
// using the `_.matches` callback shorthand
_.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
// => ['barney']
// using the `_.matchesProperty` callback shorthand
_.pluck(_.takeWhile(users, 'active', false), 'user');
// => ['barney', 'fred']
// using the `_.property` callback shorthand
_.pluck(_.takeWhile(users, 'active'), 'user');
// => []
```
* * *
### `_.union([arrays])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5655 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package")
Creates an array of unique values, in order, of the provided arrays using
`SameValueZero` for equality comparisons.
**Note:** `SameValueZero` comparisons are like strict equality comparisons,
e.g. `===`, except that `NaN` matches `NaN`. See the
[ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
for more details.
#### Arguments
1. `[arrays]` *(...Array)*: The arrays to inspect.
#### Returns
*(Array)*: Returns the new array of combined values.
#### Example
```js
_.union([1, 2], [4, 2], [2, 1]);
// => [1, 2, 4]
```
* * *
### `_.uniq(array, [isSorted], [iteratee], [thisArg])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5711 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package")
Creates a duplicate-value-free version of an array using `SameValueZero`
for equality comparisons. Providing `true` for `isSorted` performs a faster
search algorithm for sorted arrays. If an iteratee function is provided it
is invoked for each value in the array to generate the criterion by which
uniqueness is computed. The `iteratee` is bound to `thisArg` and invoked
with three arguments: (value, index, array).
If a property name is provided for `iteratee` the created `_.property`
style callback returns the property value of the given element.
If a value is also provided for `thisArg` the created `_.matchesProperty`
style callback returns `true` for elements that have a matching property
value, else `false`.
If an object is provided for `iteratee` the created `_.matches` style
callback returns `true` for elements that have the properties of the given
object, else `false`.
**Note:** `SameValueZero` comparisons are like strict equality comparisons,
e.g. `===`, except that `NaN` matches `NaN`. See the
[ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
for more details.
#### Aliases
*_.unique*
#### Arguments
1. `array` *(Array)*: The array to inspect.
2. `[isSorted]` *(boolean)*: Specify the array is sorted.
3. `[iteratee]` *(Function|Object|string)*: The function invoked per iteration.
4. `[thisArg]` *(*)*: The `this` binding of `iteratee`.
#### Returns
*(Array)*: Returns the new duplicate-value-free array.
#### Example
```js
_.uniq([1, 2, 1]);
// => [1, 2]
// using `isSorted`
_.uniq([1, 1, 2], true);
// => [1, 2]
// using an iteratee function
_.uniq([1, 2.5, 1.5, 2], function(n) {
return this.floor(n);
}, Math);
// => [1, 2.5]
// using the `_.property` callback shorthand
_.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
// => [{ 'x': 1 }, { 'x': 2 }]
```
* * *
### `_.unzip(array)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5748 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package")
This method is like `_.zip` except that it accepts an array of grouped
elements and creates an array regrouping the elements to their pre-`_.zip`
configuration.
#### Arguments
1. `array` *(Array)*: The array of grouped elements to process.
#### Returns
*(Array)*: Returns the new array of regrouped elements.
#### Example
```js
var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
// => [['fred', 30, true], ['barney', 40, false]]
_.unzip(zipped);
// => [['fred', 'barney'], [30, 40], [true, false]]
```
* * *
### `_.without(array, [values])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5779 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package")
Creates an array excluding all provided values using `SameValueZero` for
equality comparisons.
**Note:** `SameValueZero` comparisons are like strict equality comparisons,
e.g. `===`, except that `NaN` matches `NaN`. See the
[ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
for more details.
#### Arguments
1. `array` *(Array)*: The array to filter.
2. `[values]` *(...*)*: The values to exclude.
#### Returns
*(Array)*: Returns the new array of filtered values.
#### Example
```js
_.without([1, 2, 1, 3], 1, 2);
// => [3]
```
* * *
### `_.xor([arrays])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5800 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package")
Creates an array that is the symmetric difference of the provided arrays.
See [Wikipedia](https://en.wikipedia.org/wiki/Symmetric_difference) for
more details.
#### Arguments
1. `[arrays]` *(...Array)*: The arrays to inspect.
#### Returns
*(Array)*: Returns the new array of values.
#### Example
```js
_.xor([1, 2], [4, 2]);
// => [1, 4]
```
* * *
### `_.zip([arrays])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5830 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package")
Creates an array of grouped elements, the first of which contains the first
elements of the given arrays, the second of which contains the second elements
of the given arrays, and so on.
#### Arguments
1. `[arrays]` *(...Array)*: The arrays to process.
#### Returns
*(Array)*: Returns the new array of grouped elements.
#### Example
```js
_.zip(['fred', 'barney'], [30, 40], [true, false]);
// => [['fred', 30, true], ['barney', 40, false]]
```
* * *
### `_.zipObject(props, [values=[]])`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L5853 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package")
The inverse of `_.pairs`; this method returns an object composed from arrays
of property names and values. Provide either a single two dimensional array,
e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
and one of corresponding values.
#### Aliases
*_.object*
#### Arguments
1. `props` *(Array)*: The property names.
2. `[values=[]]` *(Array)*: The property values.
#### Returns
*(Object)*: Returns the new object.
#### Example
```js
_.zipObject([['fred', 30], ['barney', 40]]);
// => { 'fred': 30, 'barney': 40 }
_.zipObject(['fred', 'barney'], [30, 40]);
// => { 'fred': 30, 'barney': 40 }
```
* * *
## `“Chain” Methods`
### `_(value)`
# [Ⓢ](https://github.com/lodash/lodash/blob/3.6.0/lodash.src.js#L962 "View in source") [Ⓣ][1]
Creates a `lodash` object which wraps `value` to enable implicit chaining.
Methods that operate on and return arrays, collections, and functions can
be chained together. Methods that return a boolean or single value will
automati