# lodash v4.17.15 ## `Array` * `_.chunk` * `_.compact` * `_.concat` * `_.difference` * `_.differenceBy` * `_.differenceWith` * `_.drop` * `_.dropRight` * `_.dropRightWhile` * `_.dropWhile` * `_.fill` * `_.findIndex` * `_.findLastIndex` * `_.first` -> `head` * `_.flatten` * `_.flattenDeep` * `_.flattenDepth` * `_.fromPairs` * `_.head` * `_.indexOf` * `_.initial` * `_.intersection` * `_.intersectionBy` * `_.intersectionWith` * `_.join` * `_.last` * `_.lastIndexOf` * `_.nth` * `_.pull` * `_.pullAll` * `_.pullAllBy` * `_.pullAllWith` * `_.pullAt` * `_.remove` * `_.reverse` * `_.slice` * `_.sortedIndex` * `_.sortedIndexBy` * `_.sortedIndexOf` * `_.sortedLastIndex` * `_.sortedLastIndexBy` * `_.sortedLastIndexOf` * `_.sortedUniq` * `_.sortedUniqBy` * `_.tail` * `_.take` * `_.takeRight` * `_.takeRightWhile` * `_.takeWhile` * `_.union` * `_.unionBy` * `_.unionWith` * `_.uniq` * `_.uniqBy` * `_.uniqWith` * `_.unzip` * `_.unzipWith` * `_.without` * `_.xor` * `_.xorBy` * `_.xorWith` * `_.zip` * `_.zipObject` * `_.zipObjectDeep` * `_.zipWith` ## `Collection` * `_.countBy` * `_.each` -> `forEach` * `_.eachRight` -> `forEachRight` * `_.every` * `_.filter` * `_.find` * `_.findLast` * `_.flatMap` * `_.flatMapDeep` * `_.flatMapDepth` * `_.forEach` * `_.forEachRight` * `_.groupBy` * `_.includes` * `_.invokeMap` * `_.keyBy` * `_.map` * `_.orderBy` * `_.partition` * `_.reduce` * `_.reduceRight` * `_.reject` * `_.sample` * `_.sampleSize` * `_.shuffle` * `_.size` * `_.some` * `_.sortBy` ## `Date` * `_.now` ## `Function` * `_.after` * `_.ary` * `_.before` * `_.bind` * `_.bindKey` * `_.curry` * `_.curryRight` * `_.debounce` * `_.defer` * `_.delay` * `_.flip` * `_.memoize` * `_.negate` * `_.once` * `_.overArgs` * `_.partial` * `_.partialRight` * `_.rearg` * `_.rest` * `_.spread` * `_.throttle` * `_.unary` * `_.wrap` ## `Lang` * `_.castArray` * `_.clone` * `_.cloneDeep` * `_.cloneDeepWith` * `_.cloneWith` * `_.conformsTo` * `_.eq` * `_.gt` * `_.gte` * `_.isArguments` * `_.isArray` * `_.isArrayBuffer` * `_.isArrayLike` * `_.isArrayLikeObject` * `_.isBoolean` * `_.isBuffer` * `_.isDate` * `_.isElement` * `_.isEmpty` * `_.isEqual` * `_.isEqualWith` * `_.isError` * `_.isFinite` * `_.isFunction` * `_.isInteger` * `_.isLength` * `_.isMap` * `_.isMatch` * `_.isMatchWith` * `_.isNaN` * `_.isNative` * `_.isNil` * `_.isNull` * `_.isNumber` * `_.isObject` * `_.isObjectLike` * `_.isPlainObject` * `_.isRegExp` * `_.isSafeInteger` * `_.isSet` * `_.isString` * `_.isSymbol` * `_.isTypedArray` * `_.isUndefined` * `_.isWeakMap` * `_.isWeakSet` * `_.lt` * `_.lte` * `_.toArray` * `_.toFinite` * `_.toInteger` * `_.toLength` * `_.toNumber` * `_.toPlainObject` * `_.toSafeInteger` * `_.toString` ## `Math` * `_.add` * `_.ceil` * `_.divide` * `_.floor` * `_.max` * `_.maxBy` * `_.mean` * `_.meanBy` * `_.min` * `_.minBy` * `_.multiply` * `_.round` * `_.subtract` * `_.sum` * `_.sumBy` ## `Number` * `_.clamp` * `_.inRange` * `_.random` ## `Object` * `_.assign` * `_.assignIn` * `_.assignInWith` * `_.assignWith` * `_.at` * `_.create` * `_.defaults` * `_.defaultsDeep` * `_.entries` -> `toPairs` * `_.entriesIn` -> `toPairsIn` * `_.extend` -> `assignIn` * `_.extendWith` -> `assignInWith` * `_.findKey` * `_.findLastKey` * `_.forIn` * `_.forInRight` * `_.forOwn` * `_.forOwnRight` * `_.functions` * `_.functionsIn` * `_.get` * `_.has` * `_.hasIn` * `_.invert` * `_.invertBy` * `_.invoke` * `_.keys` * `_.keysIn` * `_.mapKeys` * `_.mapValues` * `_.merge` * `_.mergeWith` * `_.omit` * `_.omitBy` * `_.pick` * `_.pickBy` * `_.result` * `_.set` * `_.setWith` * `_.toPairs` * `_.toPairsIn` * `_.transform` * `_.unset` * `_.update` * `_.updateWith` * `_.values` * `_.valuesIn` ## `Seq` * `_` * `_.chain` * `_.tap` * `_.thru` * `_.prototype[Symbol.iterator]` * `_.prototype.at` * `_.prototype.chain` * `_.prototype.commit` * `_.prototype.next` * `_.prototype.plant` * `_.prototype.reverse` * `_.prototype.toJSON` -> `value` * `_.prototype.value` * `_.prototype.valueOf` -> `value` ## `String` * `_.camelCase` * `_.capitalize` * `_.deburr` * `_.endsWith` * `_.escape` * `_.escapeRegExp` * `_.kebabCase` * `_.lowerCase` * `_.lowerFirst` * `_.pad` * `_.padEnd` * `_.padStart` * `_.parseInt` * `_.repeat` * `_.replace` * `_.snakeCase` * `_.split` * `_.startCase` * `_.startsWith` * `_.template` * `_.toLower` * `_.toUpper` * `_.trim` * `_.trimEnd` * `_.trimStart` * `_.truncate` * `_.unescape` * `_.upperCase` * `_.upperFirst` * `_.words` ## `Util` * `_.attempt` * `_.bindAll` * `_.cond` * `_.conforms` * `_.constant` * `_.defaultTo` * `_.flow` * `_.flowRight` * `_.identity` * `_.iteratee` * `_.matches` * `_.matchesProperty` * `_.method` * `_.methodOf` * `_.mixin` * `_.noConflict` * `_.noop` * `_.nthArg` * `_.over` * `_.overEvery` * `_.overSome` * `_.property` * `_.propertyOf` * `_.range` * `_.rangeRight` * `_.runInContext` * `_.stubArray` * `_.stubFalse` * `_.stubObject` * `_.stubString` * `_.stubTrue` * `_.times` * `_.toPath` * `_.uniqueId` ## `Properties` * `_.VERSION` * `_.templateSettings` * `_.templateSettings.escape` * `_.templateSettings.evaluate` * `_.templateSettings.imports` * `_.templateSettings.interpolate` * `_.templateSettings.variable` ## `Methods` * `_.templateSettings.imports._` ## `“Array” Methods`

_.chunk(array, [size=1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L6839 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package") [Ⓣ][1] Creates an array of elements split into groups the length of `size`. If `array` can't be split evenly, the final chunk will be the remaining elements. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The array to process. 2. `[size=1]` *(number)*: The length of each chunk #### Returns *(Array)*: Returns the new array of 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/4.17.15/lodash.js#L6874 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package") [Ⓣ][1] Creates an array with all falsey values removed. The values `false`, `null`, `0`, `""`, `undefined`, and `NaN` are falsey. #### Since 0.1.0 #### 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] ``` ---

_.concat(array, [values])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L6911 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package") [Ⓣ][1] Creates a new array concatenating `array` with any additional arrays and/or values. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to concatenate. 2. `[values]` *(...*)*: The values to concatenate. #### Returns *(Array)*: Returns the new concatenated array. #### Example ```js var array = [1]; var other = _.concat(array, 2, [3], [[4]]); console.log(other); // => [1, 2, 3, [4]] console.log(array); // => [1] ``` ---

_.difference(array, [values])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L6947 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package") [Ⓣ][1] Creates an array of `array` values not included in the other given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons. The order and references of result values are determined by the first array.

**Note:** Unlike `_.pullAll`, this method returns a new array. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[values]` *(...Array)*: The values to exclude. #### Returns *(Array)*: Returns the new array of filtered values. #### Example ```js _.difference([2, 1], [2, 3]); // => [1] ``` ---

_.differenceBy(array, [values], [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L6979 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package") [Ⓣ][1] This method is like `_.difference` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument:
*(value)*.

**Note:** Unlike `_.pullAllBy`, this method returns a new array. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[values]` *(...Array)*: The values to exclude. 3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of filtered values. #### Example ```js _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); // => [1.2] // The `_.property` iteratee shorthand. _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); // => [{ 'x': 2 }] ``` ---

_.differenceWith(array, [values], [comparator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7012 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package") [Ⓣ][1] This method is like `_.difference` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: *(arrVal, othVal)*.

**Note:** Unlike `_.pullAllWith`, this method returns a new array. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[values]` *(...Array)*: The values to exclude. 3. `[comparator]` *(Function)*: The comparator invoked per element. #### Returns *(Array)*: Returns the new array of filtered values. #### Example ```js var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); // => [{ 'x': 2, 'y': 1 }] ``` ---

_.drop(array, [n=1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7047 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements dropped from the beginning. #### Since 0.5.0 #### 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/4.17.15/lodash.js#L7081 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements dropped from the end. #### Since 3.0.0 #### 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])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7126 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package") [Ⓣ][1] Creates a slice of `array` excluding elements dropped from the end. Elements are dropped until `predicate` returns falsey. The predicate is invoked with three arguments: *(value, index, array)*. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. #### Example ```js var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'active': false } ]; _.dropRightWhile(users, function(o) { return !o.active; }); // => objects for ['barney'] // The `_.matches` iteratee shorthand. _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); // => objects for ['barney', 'fred'] // The `_.matchesProperty` iteratee shorthand. _.dropRightWhile(users, ['active', false]); // => objects for ['barney'] // The `_.property` iteratee shorthand. _.dropRightWhile(users, 'active'); // => objects for ['barney', 'fred', 'pebbles'] ``` ---

_.dropWhile(array, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7167 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package") [Ⓣ][1] Creates a slice of `array` excluding elements dropped from the beginning. Elements are dropped until `predicate` returns falsey. The predicate is invoked with three arguments: *(value, index, array)*. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. #### Example ```js var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'active': true } ]; _.dropWhile(users, function(o) { return !o.active; }); // => objects for ['pebbles'] // The `_.matches` iteratee shorthand. _.dropWhile(users, { 'user': 'barney', 'active': false }); // => objects for ['fred', 'pebbles'] // The `_.matchesProperty` iteratee shorthand. _.dropWhile(users, ['active', false]); // => objects for ['pebbles'] // The `_.property` iteratee shorthand. _.dropWhile(users, 'active'); // => objects for ['barney', 'fred', 'pebbles'] ``` ---

_.fill(array, value, [start=0], [end=array.length])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7202 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package") [Ⓣ][1] Fills elements of `array` with `value` from `start` up to, but not including, `end`.

**Note:** This method mutates `array`. #### Since 3.2.0 #### 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, 10], '*', 1, 3); // => [4, '*', '*', 10] ``` ---

_.findIndex(array, [predicate=_.identity], [fromIndex=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7249 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package") [Ⓣ][1] This method is like `_.find` except that it returns the index of the first element `predicate` returns truthy for instead of the element itself. #### Since 1.1.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=0]` *(number)*: The index to search from. #### 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(o) { return o.user == 'barney'; }); // => 0 // The `_.matches` iteratee shorthand. _.findIndex(users, { 'user': 'fred', 'active': false }); // => 1 // The `_.matchesProperty` iteratee shorthand. _.findIndex(users, ['active', false]); // => 0 // The `_.property` iteratee shorthand. _.findIndex(users, 'active'); // => 2 ``` ---

_.findLastIndex(array, [predicate=_.identity], [fromIndex=array.length-1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7296 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package") [Ⓣ][1] This method is like `_.findIndex` except that it iterates over elements of `collection` from right to left. #### Since 2.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=array.length-1]` *(number)*: The index to search from. #### 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(o) { return o.user == 'pebbles'; }); // => 2 // The `_.matches` iteratee shorthand. _.findLastIndex(users, { 'user': 'barney', 'active': true }); // => 0 // The `_.matchesProperty` iteratee shorthand. _.findLastIndex(users, ['active', false]); // => 2 // The `_.property` iteratee shorthand. _.findLastIndex(users, 'active'); // => 0 ``` ---

_.flatten(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7325 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package") [Ⓣ][1] Flattens `array` a single level deep. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to flatten. #### Returns *(Array)*: Returns the new flattened array. #### Example ```js _.flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5] ``` ---

_.flattenDeep(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7344 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package") [Ⓣ][1] Recursively flattens `array`. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The array to flatten. #### Returns *(Array)*: Returns the new flattened array. #### Example ```js _.flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5] ``` ---

_.flattenDepth(array, [depth=1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7369 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flattendepth "See the npm package") [Ⓣ][1] Recursively flatten `array` up to `depth` times. #### Since 4.4.0 #### Arguments 1. `array` *(Array)*: The array to flatten. 2. `[depth=1]` *(number)*: The maximum recursion depth. #### Returns *(Array)*: Returns the new flattened array. #### Example ```js var array = [1, [2, [3, [4]], 5]]; _.flattenDepth(array, 1); // => [1, 2, [3, [4]], 5] _.flattenDepth(array, 2); // => [1, 2, 3, [4], 5] ``` ---

_.fromPairs(pairs)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7393 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package") [Ⓣ][1] The inverse of `_.toPairs`; this method returns an object composed from key-value `pairs`. #### Since 4.0.0 #### Arguments 1. `pairs` *(Array)*: The key-value pairs. #### Returns *(Object)*: Returns the new object. #### Example ```js _.fromPairs([['a', 1], ['b', 2]]); // => { 'a': 1, 'b': 2 } ``` ---

_.head(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7423 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package") [Ⓣ][1] Gets the first element of `array`. #### Since 0.1.0 #### Aliases *_.first* #### Arguments 1. `array` *(Array)*: The array to query. #### Returns *(*)*: Returns the first element of `array`. #### Example ```js _.head([1, 2, 3]); // => 1 _.head([]); // => undefined ``` ---

_.indexOf(array, value, [fromIndex=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7450 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package") [Ⓣ][1] Gets the index at which the first occurrence of `value` is found in `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons. If `fromIndex` is negative, it's used as the offset from the end of `array`. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `value` *(*)*: The value to search for. 3. `[fromIndex=0]` *(number)*: The index to search from. #### Returns *(number)*: Returns the index of the matched value, else `-1`. #### Example ```js _.indexOf([1, 2, 1, 2], 2); // => 1 // Search from the `fromIndex`. _.indexOf([1, 2, 1, 2], 2, 2); // => 3 ``` ---

_.initial(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7476 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package") [Ⓣ][1] Gets all but the last element of `array`. #### Since 0.1.0 #### 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/4.17.15/lodash.js#L7498 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package") [Ⓣ][1] Creates an array of unique values that are included in all given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons. The order and references of result values are determined by the first array. #### Since 0.1.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. #### Returns *(Array)*: Returns the new array of intersecting values. #### Example ```js _.intersection([2, 1], [2, 3]); // => [2] ``` ---

_.intersectionBy([arrays], [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7528 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package") [Ⓣ][1] This method is like `_.intersection` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument:
*(value)*. #### Since 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of intersecting values. #### Example ```js _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); // => [2.1] // The `_.property` iteratee shorthand. _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }] ``` ---

_.intersectionWith([arrays], [comparator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7563 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package") [Ⓣ][1] This method is like `_.intersection` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The order and references of result values are determined by the first array. The comparator is invoked with two arguments: *(arrVal, othVal)*. #### Since 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. 2. `[comparator]` *(Function)*: The comparator invoked per element. #### Returns *(Array)*: Returns the new array of intersecting values. #### Example ```js var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.intersectionWith(objects, others, _.isEqual); // => [{ 'x': 1, 'y': 2 }] ``` ---

_.join(array, [separator=','])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7591 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package") [Ⓣ][1] Converts all elements in `array` into a string separated by `separator`. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to convert. 2. `[separator=',']` *(string)*: The element separator. #### Returns *(string)*: Returns the joined string. #### Example ```js _.join(['a', 'b', 'c'], '~'); // => 'a~b~c' ``` ---

_.last(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7609 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package") [Ⓣ][1] Gets the last element of `array`. #### Since 0.1.0 #### 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/4.17.15/lodash.js#L7635 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package") [Ⓣ][1] This method is like `_.indexOf` except that it iterates over elements of `array` from right to left. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `value` *(*)*: The value to search for. 3. `[fromIndex=array.length-1]` *(number)*: The index to search from. #### Returns *(number)*: Returns the index of the matched value, else `-1`. #### Example ```js _.lastIndexOf([1, 2, 1, 2], 2); // => 3 // Search from the `fromIndex`. _.lastIndexOf([1, 2, 1, 2], 2, 2); // => 1 ``` ---

_.nth(array, [n=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7671 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.nth "See the npm package") [Ⓣ][1] Gets the element at index `n` of `array`. If `n` is negative, the nth element from the end is returned. #### Since 4.11.0 #### Arguments 1. `array` *(Array)*: The array to query. 2. `[n=0]` *(number)*: The index of the element to return. #### Returns *(*)*: Returns the nth element of `array`. #### Example ```js var array = ['a', 'b', 'c', 'd']; _.nth(array, 1); // => 'b' _.nth(array, -2); // => 'c'; ``` ---

_.pull(array, [values])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7698 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package") [Ⓣ][1] Removes all given values from `array` using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons.

**Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` to remove elements from an array by predicate. #### Since 2.0.0 #### Arguments 1. `array` *(Array)*: The array to modify. 2. `[values]` *(...*)*: The values to remove. #### Returns *(Array)*: Returns `array`. #### Example ```js var array = ['a', 'b', 'c', 'a', 'b', 'c']; _.pull(array, 'a', 'c'); console.log(array); // => ['b', 'b'] ``` ---

_.pullAll(array, values)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7720 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package") [Ⓣ][1] This method is like `_.pull` except that it accepts an array of values to remove.

**Note:** Unlike `_.difference`, this method mutates `array`. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to modify. 2. `values` *(Array)*: The values to remove. #### Returns *(Array)*: Returns `array`. #### Example ```js var array = ['a', 'b', 'c', 'a', 'b', 'c']; _.pullAll(array, ['a', 'c']); console.log(array); // => ['b', 'b'] ``` ---

_.pullAllBy(array, values, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7749 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package") [Ⓣ][1] This method is like `_.pullAll` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion by which they're compared. The iteratee is invoked with one argument: *(value)*.

**Note:** Unlike `_.differenceBy`, this method mutates `array`. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to modify. 2. `values` *(Array)*: The values to remove. 3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns `array`. #### Example ```js var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); console.log(array); // => [{ 'x': 2 }] ``` ---

_.pullAllWith(array, values, [comparator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7778 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullallwith "See the npm package") [Ⓣ][1] This method is like `_.pullAll` except that it accepts `comparator` which is invoked to compare elements of `array` to `values`. The comparator is invoked with two arguments: *(arrVal, othVal)*.

**Note:** Unlike `_.differenceWith`, this method mutates `array`. #### Since 4.6.0 #### Arguments 1. `array` *(Array)*: The array to modify. 2. `values` *(Array)*: The values to remove. 3. `[comparator]` *(Function)*: The comparator invoked per element. #### Returns *(Array)*: Returns `array`. #### Example ```js var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); console.log(array); // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] ``` ---

_.pullAt(array, [indexes])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7808 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package") [Ⓣ][1] Removes elements from `array` corresponding to `indexes` and returns an array of removed elements.

**Note:** Unlike `_.at`, this method mutates `array`. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The array to modify. 2. `[indexes]` *(...(number|number[]))*: The indexes of elements to remove. #### Returns *(Array)*: Returns the new array of removed elements. #### Example ```js var array = ['a', 'b', 'c', 'd']; var pulled = _.pullAt(array, [1, 3]); console.log(array); // => ['a', 'c'] console.log(pulled); // => ['b', 'd'] ``` ---

_.remove(array, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7847 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package") [Ⓣ][1] Removes all elements from `array` that `predicate` returns truthy for and returns an array of the removed elements. The predicate is invoked with three arguments: *(value, index, array)*.

**Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` to pull elements from an array by value. #### Since 2.0.0 #### Arguments 1. `array` *(Array)*: The array to modify. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### 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] ``` ---

_.reverse(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7891 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package") [Ⓣ][1] Reverses `array` so that the first element becomes the last, the second element becomes the second to last, and so on.

**Note:** This method mutates `array` and is based on [`Array#reverse`](https://mdn.io/Array/reverse). #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to modify. #### Returns *(Array)*: Returns `array`. #### Example ```js var array = [1, 2, 3]; _.reverse(array); // => [3, 2, 1] console.log(array); // => [3, 2, 1] ``` ---

_.slice(array, [start=0], [end=array.length])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7911 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package") [Ⓣ][1] Creates a slice of `array` from `start` up to, but not including, `end`.

**Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are returned. #### Since 3.0.0 #### 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)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7944 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package") [Ⓣ][1] Uses a binary search to determine the lowest index at which `value` should be inserted into `array` in order to maintain its sort order. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The sorted array to inspect. 2. `value` *(*)*: The value to evaluate. #### Returns *(number)*: Returns the index at which `value` should be inserted into `array`. #### Example ```js _.sortedIndex([30, 50], 40); // => 1 ``` ---

_.sortedIndexBy(array, value, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7973 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package") [Ⓣ][1] This method is like `_.sortedIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their sort ranking. The iteratee is invoked with one argument: *(value)*. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The sorted array to inspect. 2. `value` *(*)*: The value to evaluate. 3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the index at which `value` should be inserted into `array`. #### Example ```js var objects = [{ 'x': 4 }, { 'x': 5 }]; _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); // => 0 // The `_.property` iteratee shorthand. _.sortedIndexBy(objects, { 'x': 4 }, 'x'); // => 0 ``` ---

_.sortedIndexOf(array, value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L7993 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package") [Ⓣ][1] This method is like `_.indexOf` except that it performs a binary search on a sorted `array`. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `value` *(*)*: The value to search for. #### Returns *(number)*: Returns the index of the matched value, else `-1`. #### Example ```js _.sortedIndexOf([4, 5, 5, 5, 6], 5); // => 1 ``` ---

_.sortedLastIndex(array, value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8022 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package") [Ⓣ][1] 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. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The sorted array to inspect. 2. `value` *(*)*: The value to evaluate. #### Returns *(number)*: Returns the index at which `value` should be inserted into `array`. #### Example ```js _.sortedLastIndex([4, 5, 5, 5, 6], 5); // => 4 ``` ---

_.sortedLastIndexBy(array, value, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8051 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package") [Ⓣ][1] This method is like `_.sortedLastIndex` except that it accepts `iteratee` which is invoked for `value` and each element of `array` to compute their sort ranking. The iteratee is invoked with one argument: *(value)*. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The sorted array to inspect. 2. `value` *(*)*: The value to evaluate. 3. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the index at which `value` should be inserted into `array`. #### Example ```js var objects = [{ 'x': 4 }, { 'x': 5 }]; _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); // => 1 // The `_.property` iteratee shorthand. _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); // => 1 ``` ---

_.sortedLastIndexOf(array, value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8071 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package") [Ⓣ][1] This method is like `_.lastIndexOf` except that it performs a binary search on a sorted `array`. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `value` *(*)*: The value to search for. #### Returns *(number)*: Returns the index of the matched value, else `-1`. #### Example ```js _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); // => 3 ``` ---

_.sortedUniq(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8097 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package") [Ⓣ][1] This method is like `_.uniq` except that it's designed and optimized for sorted arrays. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. #### Returns *(Array)*: Returns the new duplicate free array. #### Example ```js _.sortedUniq([1, 1, 2]); // => [1, 2] ``` ---

_.sortedUniqBy(array, [iteratee])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8119 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package") [Ⓣ][1] This method is like `_.uniqBy` except that it's designed and optimized for sorted arrays. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[iteratee]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new duplicate free array. #### Example ```js _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); // => [1.1, 2.3] ``` ---

_.tail(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8139 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package") [Ⓣ][1] Gets all but the first element of `array`. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to query. #### Returns *(Array)*: Returns the slice of `array`. #### Example ```js _.tail([1, 2, 3]); // => [2, 3] ``` ---

_.take(array, [n=1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8169 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements taken from the beginning. #### Since 0.1.0 #### 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/4.17.15/lodash.js#L8202 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package") [Ⓣ][1] Creates a slice of `array` with `n` elements taken from the end. #### Since 3.0.0 #### 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])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8247 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package") [Ⓣ][1] Creates a slice of `array` with elements taken from the end. Elements are taken until `predicate` returns falsey. The predicate is invoked with three arguments: *(value, index, array)*. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. #### Example ```js var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'active': false } ]; _.takeRightWhile(users, function(o) { return !o.active; }); // => objects for ['fred', 'pebbles'] // The `_.matches` iteratee shorthand. _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); // => objects for ['pebbles'] // The `_.matchesProperty` iteratee shorthand. _.takeRightWhile(users, ['active', false]); // => objects for ['fred', 'pebbles'] // The `_.property` iteratee shorthand. _.takeRightWhile(users, 'active'); // => [] ``` ---

_.takeWhile(array, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8288 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package") [Ⓣ][1] Creates a slice of `array` with elements taken from the beginning. Elements are taken until `predicate` returns falsey. The predicate is invoked with three arguments: *(value, index, array)*. #### Since 3.0.0 #### Arguments 1. `array` *(Array)*: The array to query. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the slice of `array`. #### Example ```js var users = [ { 'user': 'barney', 'active': false }, { 'user': 'fred', 'active': false }, { 'user': 'pebbles', 'active': true } ]; _.takeWhile(users, function(o) { return !o.active; }); // => objects for ['barney', 'fred'] // The `_.matches` iteratee shorthand. _.takeWhile(users, { 'user': 'barney', 'active': false }); // => objects for ['barney'] // The `_.matchesProperty` iteratee shorthand. _.takeWhile(users, ['active', false]); // => objects for ['barney', 'fred'] // The `_.property` iteratee shorthand. _.takeWhile(users, 'active'); // => [] ``` ---

_.union([arrays])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8310 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package") [Ⓣ][1] Creates an array of unique values, in order, from all given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons. #### Since 0.1.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. #### Returns *(Array)*: Returns the new array of combined values. #### Example ```js _.union([2], [1, 2]); // => [2, 1] ``` ---

_.unionBy([arrays], [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8337 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package") [Ⓣ][1] This method is like `_.union` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which uniqueness is computed. Result values are chosen from the first array in which the value occurs. The iteratee is invoked with one argument:
*(value)*. #### Since 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of combined values. #### Example ```js _.unionBy([2.1], [1.2, 2.3], Math.floor); // => [2.1, 1.2] // The `_.property` iteratee shorthand. _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }] ``` ---

_.unionWith([arrays], [comparator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8366 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package") [Ⓣ][1] This method is like `_.union` except that it accepts `comparator` which is invoked to compare elements of `arrays`. Result values are chosen from the first array in which the value occurs. The comparator is invoked with two arguments: *(arrVal, othVal)*. #### Since 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. 2. `[comparator]` *(Function)*: The comparator invoked per element. #### Returns *(Array)*: Returns the new array of combined values. #### Example ```js var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.unionWith(objects, others, _.isEqual); // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] ``` ---

_.uniq(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8390 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package") [Ⓣ][1] Creates a duplicate-free version of an array, using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons, in which only the first occurrence of each element is kept. The order of result values is determined by the order they occur in the array. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to inspect. #### Returns *(Array)*: Returns the new duplicate free array. #### Example ```js _.uniq([2, 1, 2]); // => [2, 1] ``` ---

_.uniqBy(array, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8417 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package") [Ⓣ][1] This method is like `_.uniq` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which uniqueness is computed. The order of result values is determined by the order they occur in the array. The iteratee is invoked with one argument:
*(value)*. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new duplicate free array. #### Example ```js _.uniqBy([2.1, 1.2, 2.3], Math.floor); // => [2.1, 1.2] // The `_.property` iteratee shorthand. _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 1 }, { 'x': 2 }] ``` ---

_.uniqWith(array, [comparator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8441 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package") [Ⓣ][1] This method is like `_.uniq` except that it accepts `comparator` which is invoked to compare elements of `array`. The order of result values is determined by the order they occur in the array.The comparator is invoked with two arguments: *(arrVal, othVal)*. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[comparator]` *(Function)*: The comparator invoked per element. #### Returns *(Array)*: Returns the new duplicate free array. #### Example ```js var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.uniqWith(objects, _.isEqual); // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] ``` ---

_.unzip(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8465 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package") [Ⓣ][1] 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. #### Since 1.2.0 #### 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(['a', 'b'], [1, 2], [true, false]); // => [['a', 1, true], ['b', 2, false]] _.unzip(zipped); // => [['a', 'b'], [1, 2], [true, false]] ``` ---

_.unzipWith(array, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8502 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package") [Ⓣ][1] This method is like `_.unzip` except that it accepts `iteratee` to specify how regrouped values should be combined. The iteratee is invoked with the elements of each group: *(...group)*. #### Since 3.8.0 #### Arguments 1. `array` *(Array)*: The array of grouped elements to process. 2. `[iteratee=_.identity]` *(Function)*: The function to combine regrouped values. #### Returns *(Array)*: Returns the new array of regrouped elements. #### Example ```js var zipped = _.zip([1, 2], [10, 20], [100, 200]); // => [[1, 10, 100], [2, 20, 200]] _.unzipWith(zipped, _.add); // => [3, 30, 300] ``` ---

_.without(array, [values])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8535 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package") [Ⓣ][1] Creates an array excluding all given values using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) for equality comparisons.

**Note:** Unlike `_.pull`, this method returns a new array. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to inspect. 2. `[values]` *(...*)*: The values to exclude. #### Returns *(Array)*: Returns the new array of filtered values. #### Example ```js _.without([2, 1, 2, 3], 1, 2); // => [3] ``` ---

_.xor([arrays])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8559 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package") [Ⓣ][1] Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) of the given arrays. The order of result values is determined by the order they occur in the arrays. #### Since 2.4.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. #### Returns *(Array)*: Returns the new array of filtered values. #### Example ```js _.xor([2, 1], [2, 3]); // => [1, 3] ``` ---

_.xorBy([arrays], [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8586 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package") [Ⓣ][1] This method is like `_.xor` except that it accepts `iteratee` which is invoked for each element of each `arrays` to generate the criterion by which by which they're compared. The order of result values is determined by the order they occur in the arrays. The iteratee is invoked with one argument: *(value)*. #### Since 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Array)*: Returns the new array of filtered values. #### Example ```js _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); // => [1.2, 3.4] // The `_.property` iteratee shorthand. _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); // => [{ 'x': 2 }] ``` ---

_.xorWith([arrays], [comparator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8615 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package") [Ⓣ][1] This method is like `_.xor` except that it accepts `comparator` which is invoked to compare elements of `arrays`. The order of result values is determined by the order they occur in the arrays. The comparator is invoked with two arguments: *(arrVal, othVal)*. #### Since 4.0.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to inspect. 2. `[comparator]` *(Function)*: The comparator invoked per element. #### Returns *(Array)*: Returns the new array of filtered values. #### Example ```js var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; _.xorWith(objects, others, _.isEqual); // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] ``` ---

_.zip([arrays])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8637 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package") [Ⓣ][1] 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. #### Since 0.1.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to process. #### Returns *(Array)*: Returns the new array of grouped elements. #### Example ```js _.zip(['a', 'b'], [1, 2], [true, false]); // => [['a', 1, true], ['b', 2, false]] ``` ---

_.zipObject([props=[]], [values=[]])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8655 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package") [Ⓣ][1] This method is like `_.fromPairs` except that it accepts two arrays, one of property identifiers and one of corresponding values. #### Since 0.4.0 #### Arguments 1. `[props=[]]` *(Array)*: The property identifiers. 2. `[values=[]]` *(Array)*: The property values. #### Returns *(Object)*: Returns the new object. #### Example ```js _.zipObject(['a', 'b'], [1, 2]); // => { 'a': 1, 'b': 2 } ``` ---

_.zipObjectDeep([props=[]], [values=[]])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8674 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package") [Ⓣ][1] This method is like `_.zipObject` except that it supports property paths. #### Since 4.1.0 #### Arguments 1. `[props=[]]` *(Array)*: The property identifiers. 2. `[values=[]]` *(Array)*: The property values. #### Returns *(Object)*: Returns the new object. #### Example ```js _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } ``` ---

_.zipWith([arrays], [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8698 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package") [Ⓣ][1] This method is like `_.zip` except that it accepts `iteratee` to specify how grouped values should be combined. The iteratee is invoked with the elements of each group: *(...group)*. #### Since 3.8.0 #### Arguments 1. `[arrays]` *(...Array)*: The arrays to process. 2. `[iteratee=_.identity]` *(Function)*: The function to combine grouped values. #### Returns *(Array)*: Returns the new array of grouped elements. #### Example ```js _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { return a + b + c; }); // => [111, 222] ``` --- ## `“Collection” Methods`

_.countBy(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9077 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The corresponding value of each key is the number of times the key was returned by `iteratee`. The iteratee is invoked with one argument: *(value)*. #### Since 0.5.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. #### Example ```js _.countBy([6.1, 4.2, 6.3], Math.floor); // => { '4': 1, '6': 2 } // The `_.property` iteratee shorthand. _.countBy(['one', 'two', 'three'], 'length'); // => { '3': 2, '5': 1 } ``` ---

_.every(collection, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9126 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package") [Ⓣ][1] Checks if `predicate` returns truthy for **all** elements of `collection`. Iteration is stopped once `predicate` returns falsey. The predicate is invoked with three arguments: *(value, index|key, collection)*.

**Note:** This method returns `true` for [empty collections](https://en.wikipedia.org/wiki/Empty_set) because [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of elements of empty collections. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(boolean)*: Returns `true` if all elements pass the predicate check, else `false`. #### Example ```js _.every([true, 1, null, 'yes'], Boolean); // => false var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user': 'fred', 'age': 40, 'active': false } ]; // The `_.matches` iteratee shorthand. _.every(users, { 'user': 'barney', 'active': false }); // => false // The `_.matchesProperty` iteratee shorthand. _.every(users, ['active', false]); // => true // The `_.property` iteratee shorthand. _.every(users, 'active'); // => false ``` ---

_.filter(collection, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9171 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package") [Ⓣ][1] Iterates over elements of `collection`, returning an array of all elements `predicate` returns truthy for. The predicate is invoked with three arguments: *(value, index|key, collection)*.

**Note:** Unlike `_.remove`, this method returns a new array. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new filtered array. #### Example ```js var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user': 'fred', 'age': 40, 'active': false } ]; _.filter(users, function(o) { return !o.active; }); // => objects for ['fred'] // The `_.matches` iteratee shorthand. _.filter(users, { 'age': 36, 'active': true }); // => objects for ['barney'] // The `_.matchesProperty` iteratee shorthand. _.filter(users, ['active', false]); // => objects for ['fred'] // The `_.property` iteratee shorthand. _.filter(users, 'active'); // => objects for ['barney'] ``` ---

_.find(collection, [predicate=_.identity], [fromIndex=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9212 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package") [Ⓣ][1] Iterates over elements of `collection`, returning the first element `predicate` returns truthy for. The predicate is invoked with three arguments: *(value, index|key, collection)*. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to inspect. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=0]` *(number)*: The index to search from. #### Returns *(*)*: Returns the matched element, else `undefined`. #### Example ```js var users = [ { 'user': 'barney', 'age': 36, 'active': true }, { 'user': 'fred', 'age': 40, 'active': false }, { 'user': 'pebbles', 'age': 1, 'active': true } ]; _.find(users, function(o) { return o.age < 40; }); // => object for 'barney' // The `_.matches` iteratee shorthand. _.find(users, { 'age': 1, 'active': true }); // => object for 'pebbles' // The `_.matchesProperty` iteratee shorthand. _.find(users, ['active', false]); // => object for 'fred' // The `_.property` iteratee shorthand. _.find(users, 'active'); // => object for 'barney' ``` ---

_.findLast(collection, [predicate=_.identity], [fromIndex=collection.length-1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9233 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package") [Ⓣ][1] This method is like `_.find` except that it iterates over elements of `collection` from right to left. #### Since 2.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to inspect. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. 3. `[fromIndex=collection.length-1]` *(number)*: The index to search from. #### Returns *(*)*: Returns the matched element, else `undefined`. #### Example ```js _.findLast([1, 2, 3, 4], function(n) { return n % 2 == 1; }); // => 3 ``` ---

_.flatMap(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9256 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package") [Ⓣ][1] Creates a flattened array of values by running each element in `collection` thru `iteratee` and flattening the mapped results. The iteratee is invoked with three arguments: *(value, index|key, collection)*. #### Since 4.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new flattened array. #### Example ```js function duplicate(n) { return [n, n]; } _.flatMap([1, 2], duplicate); // => [1, 1, 2, 2] ``` ---

_.flatMapDeep(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9280 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package") [Ⓣ][1] This method is like `_.flatMap` except that it recursively flattens the mapped results. #### Since 4.7.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new flattened array. #### Example ```js function duplicate(n) { return [[[n, n]]]; } _.flatMapDeep([1, 2], duplicate); // => [1, 1, 2, 2] ``` ---

_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9305 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package") [Ⓣ][1] This method is like `_.flatMap` except that it recursively flattens the mapped results up to `depth` times. #### Since 4.7.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. 3. `[depth=1]` *(number)*: The maximum recursion depth. #### Returns *(Array)*: Returns the new flattened array. #### Example ```js function duplicate(n) { return [[[n, n]]]; } _.flatMapDepth([1, 2], duplicate, 2); // => [[1, 1], [2, 2]] ``` ---

_.forEach(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9340 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package") [Ⓣ][1] Iterates over elements of `collection` and invokes `iteratee` for each element. The iteratee is invoked with three arguments: *(value, index|key, collection)*. Iteratee functions may exit iteration early by explicitly returning `false`.

**Note:** As with other "Collections" methods, objects with a "length" property are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn` for object iteration. #### Since 0.1.0 #### Aliases *_.each* #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(*)*: Returns `collection`. #### Example ```js _.forEach([1, 2], function(value) { console.log(value); }); // => Logs `1` then `2`. _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { console.log(key); }); // => Logs 'a' then 'b' (iteration order is not guaranteed). ``` ---

_.forEachRight(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9365 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package") [Ⓣ][1] This method is like `_.forEach` except that it iterates over elements of `collection` from right to left. #### Since 2.0.0 #### Aliases *_.eachRight* #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(*)*: Returns `collection`. #### Example ```js _.forEachRight([1, 2], function(value) { console.log(value); }); // => Logs `2` then `1`. ``` ---

_.groupBy(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9393 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The order of grouped values is determined by the order they occur in `collection`. The corresponding value of each key is an array of elements responsible for generating the key. The iteratee is invoked with one argument: *(value)*. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. #### Example ```js _.groupBy([6.1, 4.2, 6.3], Math.floor); // => { '4': [4.2], '6': [6.1, 6.3] } // The `_.property` iteratee shorthand. _.groupBy(['one', 'two', 'three'], 'length'); // => { '3': ['one', 'two'], '5': ['three'] } ``` ---

_.includes(collection, value, [fromIndex=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9431 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package") [Ⓣ][1] Checks if `value` is in `collection`. If `collection` is a string, it's checked for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) is used for equality comparisons. If `fromIndex` is negative, it's used as the offset from the end of `collection`. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object|string)*: The collection to inspect. 2. `value` *(*)*: The value to search for. 3. `[fromIndex=0]` *(number)*: The index to search from. #### Returns *(boolean)*: Returns `true` if `value` is found, else `false`. #### Example ```js _.includes([1, 2, 3], 1); // => true _.includes([1, 2, 3], 1, 2); // => false _.includes({ 'a': 1, 'b': 2 }, 1); // => true _.includes('abcd', 'bc'); // => true ``` ---

_.invokeMap(collection, path, [args])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9467 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package") [Ⓣ][1] Invokes the method at `path` of each element in `collection`, returning an array of the results of each invoked method. Any additional arguments are provided to each invoked method. If `path` is a function, it's invoked for, and `this` bound to, each element in `collection`. #### Since 4.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `path` *(Array|Function|string)*: The path of the method to invoke or the function invoked per iteration. 3. `[args]` *(...*)*: The arguments to invoke each method with. #### Returns *(Array)*: Returns the array of results. #### Example ```js _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); // => [[1, 5, 7], [1, 2, 3]] _.invokeMap([123, 456], String.prototype.split, ''); // => [['1', '2', '3'], ['4', '5', '6']] ``` ---

_.keyBy(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9506 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package") [Ⓣ][1] Creates an object composed of keys generated from the results of running each element of `collection` thru `iteratee`. The corresponding value of each key is the last element responsible for generating the key. The iteratee is invoked with one argument: *(value)*. #### Since 4.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The iteratee to transform keys. #### Returns *(Object)*: Returns the composed aggregate object. #### Example ```js var array = [ { 'dir': 'left', 'code': 97 }, { 'dir': 'right', 'code': 100 } ]; _.keyBy(array, function(o) { return String.fromCharCode(o.code); }); // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } _.keyBy(array, 'dir'); // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } ``` ---

_.map(collection, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9552 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package") [Ⓣ][1] Creates an array of values by running each element in `collection` thru `iteratee`. The iteratee is invoked with three arguments:
*(value, index|key, collection)*.

Many lodash methods are guarded to work as iteratees for methods like `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.

The guarded methods are:
`ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`, and `words` #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new mapped array. #### Example ```js function square(n) { return n * n; } _.map([4, 8], square); // => [16, 64] _.map({ 'a': 4, 'b': 8 }, square); // => [16, 64] (iteration order is not guaranteed) var users = [ { 'user': 'barney' }, { 'user': 'fred' } ]; // The `_.property` iteratee shorthand. _.map(users, 'user'); // => ['barney', 'fred'] ``` ---

_.orderBy(collection, [iteratees=[_.identity]], [orders])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9586 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package") [Ⓣ][1] This method is like `_.sortBy` except that it allows specifying the sort orders of the iteratees to sort by. If `orders` is unspecified, all values are sorted in ascending order. Otherwise, specify an order of "desc" for descending or "asc" for ascending sort order of corresponding values. #### Since 4.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratees=[_.identity]]` *(Array[]|Function[]|Object[]|string[])*: The iteratees to sort by. 3. `[orders]` *(string[])*: The sort orders of `iteratees`. #### Returns *(Array)*: Returns the new sorted array. #### Example ```js var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age': 34 }, { 'user': 'fred', 'age': 40 }, { 'user': 'barney', 'age': 36 } ]; // Sort by `user` in ascending order and by `age` in descending order. _.orderBy(users, ['user', 'age'], ['asc', 'desc']); // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] ``` ---

_.partition(collection, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9636 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package") [Ⓣ][1] Creates an array of elements split into two groups, the first of which contains elements `predicate` returns truthy for, the second of which contains elements `predicate` returns falsey for. The predicate is invoked with one argument: *(value)*. #### Since 3.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the array of grouped elements. #### Example ```js var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user': 'fred', 'age': 40, 'active': true }, { 'user': 'pebbles', 'age': 1, 'active': false } ]; _.partition(users, function(o) { return o.active; }); // => objects for [['fred'], ['barney', 'pebbles']] // The `_.matches` iteratee shorthand. _.partition(users, { 'age': 1, 'active': false }); // => objects for [['pebbles'], ['barney', 'fred']] // The `_.matchesProperty` iteratee shorthand. _.partition(users, ['active', false]); // => objects for [['barney', 'pebbles'], ['fred']] // The `_.property` iteratee shorthand. _.partition(users, 'active'); // => objects for [['fred'], ['barney', 'pebbles']] ``` ---

_.reduce(collection, [iteratee=_.identity], [accumulator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9677 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package") [Ⓣ][1] Reduces `collection` to a value which is the accumulated result of running each element in `collection` thru `iteratee`, where each successive invocation is supplied the return value of the previous. If `accumulator` is not given, the first element of `collection` is used as the initial value. The iteratee is invoked with four arguments:
*(accumulator, value, index|key, collection)*.

Many lodash methods are guarded to work as iteratees for methods like `_.reduce`, `_.reduceRight`, and `_.transform`.

The guarded methods are:
`assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, and `sortBy` #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. 3. `[accumulator]` *(*)*: The initial value. #### Returns *(*)*: Returns the accumulated value. #### Example ```js _.reduce([1, 2], function(sum, n) { return sum + n; }, 0); // => 3 _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { (result[value] || (result[value] = [])).push(key); return result; }, {}); // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) ``` ---

_.reduceRight(collection, [iteratee=_.identity], [accumulator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9706 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package") [Ⓣ][1] This method is like `_.reduce` except that it iterates over elements of `collection` from right to left. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. 3. `[accumulator]` *(*)*: The initial value. #### Returns *(*)*: Returns the accumulated value. #### Example ```js var array = [[0, 1], [2, 3], [4, 5]]; _.reduceRight(array, function(flattened, other) { return flattened.concat(other); }, []); // => [4, 5, 2, 3, 0, 1] ``` ---

_.reject(collection, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9747 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package") [Ⓣ][1] The opposite of `_.filter`; this method returns the elements of `collection` that `predicate` does **not** return truthy for. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Array)*: Returns the new filtered array. #### Example ```js var users = [ { 'user': 'barney', 'age': 36, 'active': false }, { 'user': 'fred', 'age': 40, 'active': true } ]; _.reject(users, function(o) { return !o.active; }); // => objects for ['fred'] // The `_.matches` iteratee shorthand. _.reject(users, { 'age': 40, 'active': true }); // => objects for ['barney'] // The `_.matchesProperty` iteratee shorthand. _.reject(users, ['active', false]); // => objects for ['fred'] // The `_.property` iteratee shorthand. _.reject(users, 'active'); // => objects for ['barney'] ``` ---

_.sample(collection)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9766 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package") [Ⓣ][1] Gets a random element from `collection`. #### Since 2.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to sample. #### Returns *(*)*: Returns the random element. #### Example ```js _.sample([1, 2, 3, 4]); // => 2 ``` ---

_.sampleSize(collection, [n=1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9791 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package") [Ⓣ][1] Gets `n` random elements at unique keys from `collection` up to the size of `collection`. #### Since 4.0.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to sample. 2. `[n=1]` *(number)*: The number of elements to sample. #### Returns *(Array)*: Returns the random elements. #### Example ```js _.sampleSize([1, 2, 3], 2); // => [3, 1] _.sampleSize([1, 2, 3], 4); // => [2, 3, 1] ``` ---

_.shuffle(collection)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9816 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package") [Ⓣ][1] Creates an array of shuffled values, using a version of the [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to shuffle. #### Returns *(Array)*: Returns the new shuffled array. #### Example ```js _.shuffle([1, 2, 3, 4]); // => [4, 1, 3, 2] ``` ---

_.size(collection)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9842 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package") [Ⓣ][1] Gets the size of `collection` by returning its length for array-like values or the number of own enumerable string keyed properties for objects. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object|string)*: The collection to inspect. #### Returns *(number)*: Returns the collection size. #### Example ```js _.size([1, 2, 3]); // => 3 _.size({ 'a': 1, 'b': 2 }); // => 2 _.size('pebbles'); // => 7 ``` ---

_.some(collection, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9892 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package") [Ⓣ][1] Checks if `predicate` returns truthy for **any** element of `collection`. Iteration is stopped once `predicate` returns truthy. The predicate is invoked with three arguments: *(value, index|key, collection)*. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(boolean)*: Returns `true` if any element passes the predicate check, else `false`. #### Example ```js _.some([null, 0, 'yes', false], Boolean); // => true var users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': false } ]; // The `_.matches` iteratee shorthand. _.some(users, { 'user': 'barney', 'active': false }); // => false // The `_.matchesProperty` iteratee shorthand. _.some(users, ['active', false]); // => true // The `_.property` iteratee shorthand. _.some(users, 'active'); // => true ``` ---

_.sortBy(collection, [iteratees=[_.identity]])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9929 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package") [Ⓣ][1] Creates an array of elements, sorted in ascending order by the results of running each element in a collection thru each iteratee. This method performs a stable sort, that is, it preserves the original sort order of equal elements. The iteratees are invoked with one argument: *(value)*. #### Since 0.1.0 #### Arguments 1. `collection` *(Array|Object)*: The collection to iterate over. 2. `[iteratees=[_.identity]]` *(...(Function|Function[]))*: The iteratees to sort by. #### Returns *(Array)*: Returns the new sorted array. #### Example ```js var users = [ { 'user': 'fred', 'age': 48 }, { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }, { 'user': 'barney', 'age': 34 } ]; _.sortBy(users, [function(o) { return o.user; }]); // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] _.sortBy(users, ['user', 'age']); // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] ``` --- ## `“Date” Methods`

_.now()

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9960 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package") [Ⓣ][1] Gets the timestamp of the number of milliseconds that have elapsed since the Unix epoch *(1 January `1970 00`:00:00 UTC)*. #### Since 2.4.0 #### Returns *(number)*: Returns the timestamp. #### Example ```js _.defer(function(stamp) { console.log(_.now() - stamp); }, _.now()); // => Logs the number of milliseconds it took for the deferred invocation. ``` --- ## `“Function” Methods`

_.after(n, func)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9990 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package") [Ⓣ][1] The opposite of `_.before`; this method creates a function that invokes `func` once it's called `n` or more times. #### Since 0.1.0 #### Arguments 1. `n` *(number)*: The number of calls before `func` is invoked. 2. `func` *(Function)*: The function to restrict. #### Returns *(Function)*: Returns the new restricted function. #### Example ```js var saves = ['profile', 'settings']; var done = _.after(saves.length, function() { console.log('done saving!'); }); _.forEach(saves, function(type) { asyncSave({ 'type': type, 'complete': done }); }); // => Logs 'done saving!' after the two async saves have completed. ``` ---

_.ary(func, [n=func.length])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10019 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package") [Ⓣ][1] Creates a function that invokes `func`, with up to `n` arguments, ignoring any additional arguments. #### Since 3.0.0 #### Arguments 1. `func` *(Function)*: The function to cap arguments for. 2. `[n=func.length]` *(number)*: The arity cap. #### Returns *(Function)*: Returns the new capped function. #### Example ```js _.map(['6', '8', '10'], _.ary(parseInt, 1)); // => [6, 8, 10] ``` ---

_.before(n, func)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10042 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package") [Ⓣ][1] Creates a function that invokes `func`, with the `this` binding and arguments of the created function, while it's called less than `n` times. Subsequent calls to the created function return the result of the last `func` invocation. #### Since 3.0.0 #### Arguments 1. `n` *(number)*: The number of calls at which `func` is no longer invoked. 2. `func` *(Function)*: The function to restrict. #### Returns *(Function)*: Returns the new restricted function. #### Example ```js jQuery(element).on('click', _.before(5, addContactToList)); // => Allows adding up to 4 contacts to the list. ``` ---

_.bind(func, thisArg, [partials])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10094 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with the `this` binding of `thisArg` and `partials` prepended to the arguments it receives.

The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, may be used as a placeholder for partially applied arguments.

**Note:** Unlike native `Function#bind`, this method doesn't set the "length" property of bound functions. #### Since 0.1.0 #### Arguments 1. `func` *(Function)*: The function to bind. 2. `thisArg` *(*)*: The `this` binding of `func`. 3. `[partials]` *(...*)*: The arguments to be partially applied. #### Returns *(Function)*: Returns the new bound function. #### Example ```js function greet(greeting, punctuation) { return greeting + ' ' + this.user + punctuation; } var object = { 'user': 'fred' }; var bound = _.bind(greet, object, 'hi'); bound('!'); // => 'hi fred!' // Bound with placeholders. var bound = _.bind(greet, object, _, '!'); bound('hi'); // => 'hi fred!' ``` ---

_.bindKey(object, key, [partials])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10148 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package") [Ⓣ][1] Creates a function that invokes the method at `object[key]` with `partials` prepended to the arguments it receives.

This method differs from `_.bind` by allowing bound functions to reference methods that may be redefined or don't yet exist. See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) for more details.

The `_.bindKey.placeholder` value, which defaults to `_` in monolithic builds, may be used as a placeholder for partially applied arguments. #### Since 0.10.0 #### Arguments 1. `object` *(Object)*: The object to invoke the method on. 2. `key` *(string)*: The key of the method. 3. `[partials]` *(...*)*: The arguments to be partially applied. #### Returns *(Function)*: Returns the new bound function. #### Example ```js var object = { 'user': 'fred', 'greet': function(greeting, punctuation) { return greeting + ' ' + this.user + punctuation; } }; var bound = _.bindKey(object, 'greet', 'hi'); bound('!'); // => 'hi fred!' object.greet = function(greeting, punctuation) { return greeting + 'ya ' + this.user + punctuation; }; bound('!'); // => 'hiya fred!' // Bound with placeholders. var bound = _.bindKey(object, 'greet', _, '!'); bound('hi'); // => 'hiya fred!' ``` ---

_.curry(func, [arity=func.length])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10198 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package") [Ⓣ][1] Creates a function that accepts arguments of `func` and either invokes `func` returning its result, if at least `arity` number of arguments have been provided, or returns a function that accepts the remaining `func` arguments, and so on. The arity of `func` may be specified if `func.length` is not sufficient.

The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, may be used as a placeholder for provided arguments.

**Note:** This method doesn't set the "length" property of curried functions. #### Since 2.0.0 #### Arguments 1. `func` *(Function)*: The function to curry. 2. `[arity=func.length]` *(number)*: The arity of `func`. #### Returns *(Function)*: Returns the new curried function. #### Example ```js var abc = function(a, b, c) { return [a, b, c]; }; var curried = _.curry(abc); curried(1)(2)(3); // => [1, 2, 3] curried(1, 2)(3); // => [1, 2, 3] curried(1, 2, 3); // => [1, 2, 3] // Curried with placeholders. curried(1)(_, 3)(2); // => [1, 2, 3] ``` ---

_.curryRight(func, [arity=func.length])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10243 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package") [Ⓣ][1] This method is like `_.curry` except that arguments are applied to `func` in the manner of `_.partialRight` instead of `_.partial`.

The `_.curryRight.placeholder` value, which defaults to `_` in monolithic builds, may be used as a placeholder for provided arguments.

**Note:** This method doesn't set the "length" property of curried functions. #### Since 3.0.0 #### Arguments 1. `func` *(Function)*: The function to curry. 2. `[arity=func.length]` *(number)*: The arity of `func`. #### Returns *(Function)*: Returns the new curried function. #### Example ```js var abc = function(a, b, c) { return [a, b, c]; }; var curried = _.curryRight(abc); curried(3)(2)(1); // => [1, 2, 3] curried(2, 3)(1); // => [1, 2, 3] curried(1, 2, 3); // => [1, 2, 3] // Curried with placeholders. curried(3)(1, _)(2); // => [1, 2, 3] ``` ---

_.debounce(func, [wait=0], [options={}])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10304 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package") [Ⓣ][1] Creates a debounced function that delays invoking `func` until after `wait` milliseconds have elapsed since the last time the debounced function was invoked. The debounced function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the debounced function. Subsequent calls to the debounced function return the result of the last `func` invocation.

**Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the debounced function is invoked more than once during the `wait` timeout.

If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`.

See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.debounce` and `_.throttle`. #### Since 0.1.0 #### Arguments 1. `func` *(Function)*: The function to debounce. 2. `[wait=0]` *(number)*: The number of milliseconds to delay. 3. `[options={}]` *(Object)*: The options object. 4. `[options.leading=false]` *(boolean)*: Specify invoking on the leading edge of the timeout. 5. `[options.maxWait]` *(number)*: The maximum time `func` is allowed to be delayed before it's invoked. 6. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout. #### Returns *(Function)*: Returns the new debounced function. #### Example ```js // Avoid costly calculations while the window size is in flux. jQuery(window).on('resize', _.debounce(calculateLayout, 150)); // Invoke `sendMail` when clicked, debouncing subsequent calls. jQuery(element).on('click', _.debounce(sendMail, 300, { 'leading': true, 'trailing': false })); // Ensure `batchLog` is invoked once after 1 second of debounced calls. var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); var source = new EventSource('/stream'); jQuery(source).on('message', debounced); // Cancel the trailing debounced invocation. jQuery(window).on('popstate', debounced.cancel); ``` ---

_.defer(func, [args])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10447 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package") [Ⓣ][1] Defers invoking the `func` until the current call stack has cleared. Any additional arguments are provided to `func` when it's invoked. #### Since 0.1.0 #### Arguments 1. `func` *(Function)*: The function to defer. 2. `[args]` *(...*)*: The arguments to invoke `func` with. #### Returns *(number)*: Returns the timer id. #### Example ```js _.defer(function(text) { console.log(text); }, 'deferred'); // => Logs 'deferred' after one millisecond. ``` ---

_.delay(func, wait, [args])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10470 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package") [Ⓣ][1] Invokes `func` after `wait` milliseconds. Any additional arguments are provided to `func` when it's invoked. #### Since 0.1.0 #### Arguments 1. `func` *(Function)*: The function to delay. 2. `wait` *(number)*: The number of milliseconds to delay invocation. 3. `[args]` *(...*)*: The arguments to invoke `func` with. #### Returns *(number)*: Returns the timer id. #### Example ```js _.delay(function(text) { console.log(text); }, 1000, 'later'); // => Logs 'later' after one second. ``` ---

_.flip(func)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10492 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with arguments reversed. #### Since 4.0.0 #### Arguments 1. `func` *(Function)*: The function to flip arguments for. #### Returns *(Function)*: Returns the new flipped function. #### Example ```js var flipped = _.flip(function() { return _.toArray(arguments); }); flipped('a', 'b', 'c', 'd'); // => ['d', 'c', 'b', 'a'] ``` ---

_.memoize(func, [resolver])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10540 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package") [Ⓣ][1] Creates a function that memoizes the result of `func`. If `resolver` is provided, it determines the cache key for storing the result based on the arguments provided to the memoized function. By default, the first argument provided to the memoized function is used as the map cache key. The `func` is invoked with the `this` binding of the memoized function.

**Note:** The cache is exposed as the `cache` property on the memoized function. Its creation may be customized by replacing the `_.memoize.Cache` constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) method interface of `clear`, `delete`, `get`, `has`, and `set`. #### Since 0.1.0 #### Arguments 1. `func` *(Function)*: The function to have its output memoized. 2. `[resolver]` *(Function)*: The function to resolve the cache key. #### Returns *(Function)*: Returns the new memoized function. #### Example ```js var object = { 'a': 1, 'b': 2 }; var other = { 'c': 3, 'd': 4 }; var values = _.memoize(_.values); values(object); // => [1, 2] values(other); // => [3, 4] object.a = 2; values(object); // => [1, 2] // Modify the result cache. values.cache.set(object, ['a', 'b']); values(object); // => ['a', 'b'] // Replace `_.memoize.Cache`. _.memoize.Cache = WeakMap; ``` ---

_.negate(predicate)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10583 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package") [Ⓣ][1] Creates a function that negates the result of the predicate `func`. The `func` predicate is invoked with the `this` binding and arguments of the created function. #### Since 3.0.0 #### Arguments 1. `predicate` *(Function)*: The predicate to negate. #### Returns *(Function)*: Returns the new negated function. #### Example ```js function isEven(n) { return n % 2 == 0; } _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); // => [1, 3, 5] ``` ---

_.once(func)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10617 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package") [Ⓣ][1] Creates a function that is restricted to invoking `func` once. Repeat calls to the function return the value of the first invocation. The `func` is invoked with the `this` binding and arguments of the created function. #### Since 0.1.0 #### Arguments 1. `func` *(Function)*: The function to restrict. #### Returns *(Function)*: Returns the new restricted function. #### Example ```js var initialize = _.once(createApplication); initialize(); initialize(); // => `createApplication` is invoked once ``` ---

_.overArgs(func, [transforms=[_.identity]])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10652 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with its arguments transformed. #### Since 4.0.0 #### Arguments 1. `func` *(Function)*: The function to wrap. 2. `[transforms=[_.identity]]` *(...(Function|Function[]))*: The argument transforms. #### Returns *(Function)*: Returns the new function. #### Example ```js function doubled(n) { return n * 2; } function square(n) { return n * n; } var func = _.overArgs(function(x, y) { return [x, y]; }, [square, doubled]); func(9, 3); // => [81, 6] func(10, 5); // => [100, 10] ``` ---

_.partial(func, [partials])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10702 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with `partials` prepended to the arguments it receives. This method is like `_.bind` except it does **not** alter the `this` binding.

The `_.partial.placeholder` value, which defaults to `_` in monolithic builds, may be used as a placeholder for partially applied arguments.

**Note:** This method doesn't set the "length" property of partially applied functions. #### Since 0.2.0 #### Arguments 1. `func` *(Function)*: The function to partially apply arguments to. 2. `[partials]` *(...*)*: The arguments to be partially applied. #### Returns *(Function)*: Returns the new partially applied function. #### Example ```js function greet(greeting, name) { return greeting + ' ' + name; } var sayHelloTo = _.partial(greet, 'hello'); sayHelloTo('fred'); // => 'hello fred' // Partially applied with placeholders. var greetFred = _.partial(greet, _, 'fred'); greetFred('hi'); // => 'hi fred' ``` ---

_.partialRight(func, [partials])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10739 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package") [Ⓣ][1] This method is like `_.partial` except that partially applied arguments are appended to the arguments it receives.

The `_.partialRight.placeholder` value, which defaults to `_` in monolithic builds, may be used as a placeholder for partially applied arguments.

**Note:** This method doesn't set the "length" property of partially applied functions. #### Since 1.0.0 #### Arguments 1. `func` *(Function)*: The function to partially apply arguments to. 2. `[partials]` *(...*)*: The arguments to be partially applied. #### Returns *(Function)*: Returns the new partially applied function. #### Example ```js function greet(greeting, name) { return greeting + ' ' + name; } var greetFred = _.partialRight(greet, 'fred'); greetFred('hi'); // => 'hi fred' // Partially applied with placeholders. var sayHelloTo = _.partialRight(greet, 'hello', _); sayHelloTo('fred'); // => 'hello fred' ``` ---

_.rearg(func, indexes)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10766 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with arguments arranged according to the specified `indexes` where the argument value at the first index is provided as the first argument, the argument value at the second index is provided as the second argument, and so on. #### Since 3.0.0 #### Arguments 1. `func` *(Function)*: The function to rearrange arguments for. 2. `indexes` *(...(number|number[]))*: The arranged argument indexes. #### Returns *(Function)*: Returns the new function. #### Example ```js var rearged = _.rearg(function(a, b, c) { return [a, b, c]; }, [2, 0, 1]); rearged('b', 'c', 'a') // => ['a', 'b', 'c'] ``` ---

_.rest(func, [start=func.length-1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10795 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with the `this` binding of the created function and arguments from `start` and beyond provided as an array.

**Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters). #### Since 4.0.0 #### Arguments 1. `func` *(Function)*: The function to apply a rest parameter to. 2. `[start=func.length-1]` *(number)*: The start position of the rest parameter. #### Returns *(Function)*: Returns the new function. #### Example ```js var say = _.rest(function(what, names) { return what + ' ' + _.initial(names).join(', ') + (_.size(names) > 1 ? ', & ' : '') + _.last(names); }); say('hello', 'fred', 'barney', 'pebbles'); // => 'hello fred, barney, & pebbles' ``` ---

_.spread(func, [start=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10837 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package") [Ⓣ][1] Creates a function that invokes `func` with the `this` binding of the create function and an array of arguments much like [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).

**Note:** This method is based on the [spread operator](https://mdn.io/spread_operator). #### Since 3.2.0 #### Arguments 1. `func` *(Function)*: The function to spread arguments over. 2. `[start=0]` *(number)*: The start position of the spread. #### Returns *(Function)*: Returns the new function. #### Example ```js var say = _.spread(function(who, what) { return who + ' says ' + what; }); say(['fred', 'hello']); // => 'fred says hello' var numbers = Promise.all([ Promise.resolve(40), Promise.resolve(36) ]); numbers.then(_.spread(function(x, y) { return x + y; })); // => a Promise of 76 ``` ---

_.throttle(func, [wait=0], [options={}])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10897 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package") [Ⓣ][1] Creates a throttled function that only invokes `func` at most once per every `wait` milliseconds. The throttled function comes with a `cancel` method to cancel delayed `func` invocations and a `flush` method to immediately invoke them. Provide `options` to indicate whether `func` should be invoked on the leading and/or trailing edge of the `wait` timeout. The `func` is invoked with the last arguments provided to the throttled function. Subsequent calls to the throttled function return the result of the last `func` invocation.

**Note:** If `leading` and `trailing` options are `true`, `func` is invoked on the trailing edge of the timeout only if the throttled function is invoked more than once during the `wait` timeout.

If `wait` is `0` and `leading` is `false`, `func` invocation is deferred until to the next tick, similar to `setTimeout` with a timeout of `0`.

See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) for details over the differences between `_.throttle` and `_.debounce`. #### Since 0.1.0 #### Arguments 1. `func` *(Function)*: The function to throttle. 2. `[wait=0]` *(number)*: The number of milliseconds to throttle invocations to. 3. `[options={}]` *(Object)*: The options object. 4. `[options.leading=true]` *(boolean)*: Specify invoking on the leading edge of the timeout. 5. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout. #### Returns *(Function)*: Returns the new throttled function. #### Example ```js // Avoid excessively updating the position while scrolling. jQuery(window).on('scroll', _.throttle(updatePosition, 100)); // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); jQuery(element).on('click', throttled); // Cancel the trailing throttled invocation. jQuery(window).on('popstate', throttled.cancel); ``` ---

_.unary(func)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10930 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package") [Ⓣ][1] Creates a function that accepts up to one argument, ignoring any additional arguments. #### Since 4.0.0 #### Arguments 1. `func` *(Function)*: The function to cap arguments for. #### Returns *(Function)*: Returns the new capped function. #### Example ```js _.map(['6', '8', '10'], _.unary(parseInt)); // => [6, 8, 10] ``` ---

_.wrap(value, [wrapper=identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10956 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package") [Ⓣ][1] Creates a function that provides `value` to `wrapper` as its first argument. Any additional arguments provided to the function are appended to those provided to the `wrapper`. The wrapper is invoked with the `this` binding of the created function. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to wrap. 2. `[wrapper=identity]` *(Function)*: The wrapper function. #### Returns *(Function)*: Returns the new function. #### Example ```js var p = _.wrap(_.escape, function(func, text) { return '

' + func(text) + '

'; }); p('fred, barney, & pebbles'); // => '

fred, barney, & pebbles

' ``` --- ## `“Lang” Methods`

_.castArray(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L10995 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.castarray "See the npm package") [Ⓣ][1] Casts `value` as an array if it's not one. #### Since 4.4.0 #### Arguments 1. `value` *(*)*: The value to inspect. #### Returns *(Array)*: Returns the cast array. #### Example ```js _.castArray(1); // => [1] _.castArray({ 'a': 1 }); // => [{ 'a': 1 }] _.castArray('abc'); // => ['abc'] _.castArray(null); // => [null] _.castArray(undefined); // => [undefined] _.castArray(); // => [] var array = [1, 2, 3]; console.log(_.castArray(array) === array); // => true ``` ---

_.clone(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11029 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package") [Ⓣ][1] Creates a shallow clone of `value`.

**Note:** This method is loosely based on the [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) and supports cloning arrays, array buffers, booleans, date objects, maps, numbers, `Object` objects, regexes, sets, strings, symbols, and typed arrays. The own enumerable properties of `arguments` objects are cloned as plain objects. An empty object is returned for uncloneable values such as error objects, functions, DOM nodes, and WeakMaps. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to clone. #### Returns *(*)*: Returns the cloned value. #### Example ```js var objects = [{ 'a': 1 }, { 'b': 2 }]; var shallow = _.clone(objects); console.log(shallow[0] === objects[0]); // => true ``` ---

_.cloneDeep(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11087 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package") [Ⓣ][1] This method is like `_.clone` except that it recursively clones `value`. #### Since 1.0.0 #### Arguments 1. `value` *(*)*: The value to recursively clone. #### Returns *(*)*: Returns the deep cloned value. #### Example ```js var objects = [{ 'a': 1 }, { 'b': 2 }]; var deep = _.cloneDeep(objects); console.log(deep[0] === objects[0]); // => false ``` ---

_.cloneDeepWith(value, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11119 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package") [Ⓣ][1] This method is like `_.cloneWith` except that it recursively clones `value`. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to recursively clone. 2. `[customizer]` *(Function)*: The function to customize cloning. #### Returns *(*)*: Returns the deep cloned value. #### Example ```js function customizer(value) { if (_.isElement(value)) { return value.cloneNode(true); } } var el = _.cloneDeepWith(document.body, customizer); console.log(el === document.body); // => false console.log(el.nodeName); // => 'BODY' console.log(el.childNodes.length); // => 20 ``` ---

_.cloneWith(value, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11064 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package") [Ⓣ][1] This method is like `_.clone` except that it accepts `customizer` which is invoked to produce the cloned value. If `customizer` returns `undefined`, cloning is handled by the method instead. The `customizer` is invoked with up to four arguments; *(value [, index|key, object, stack])*. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to clone. 2. `[customizer]` *(Function)*: The function to customize cloning. #### Returns *(*)*: Returns the cloned value. #### Example ```js function customizer(value) { if (_.isElement(value)) { return value.cloneNode(false); } } var el = _.cloneWith(document.body, customizer); console.log(el === document.body); // => false console.log(el.nodeName); // => 'BODY' console.log(el.childNodes.length); // => 0 ``` ---

_.conformsTo(object, source)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11148 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.conformsto "See the npm package") [Ⓣ][1] Checks if `object` conforms to `source` by invoking the predicate properties of `source` with the corresponding property values of `object`.

**Note:** This method is equivalent to `_.conforms` when `source` is partially applied. #### Since 4.14.0 #### Arguments 1. `object` *(Object)*: The object to inspect. 2. `source` *(Object)*: The object of property predicates to conform to. #### Returns *(boolean)*: Returns `true` if `object` conforms, else `false`. #### Example ```js var object = { 'a': 1, 'b': 2 }; _.conformsTo(object, { 'b': function(n) { return n > 1; } }); // => true _.conformsTo(object, { 'b': function(n) { return n > 2; } }); // => false ``` ---

_.eq(value, other)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11184 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package") [Ⓣ][1] Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) comparison between two values to determine if they are equivalent. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to compare. 2. `other` *(*)*: The other value to compare. #### Returns *(boolean)*: Returns `true` if the values are equivalent, else `false`. #### Example ```js var object = { 'a': 1 }; var other = { 'a': 1 }; _.eq(object, object); // => true _.eq(object, other); // => false _.eq('a', 'a'); // => true _.eq('a', Object('a')); // => false _.eq(NaN, NaN); // => true ``` ---

_.gt(value, other)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11211 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package") [Ⓣ][1] Checks if `value` is greater than `other`. #### Since 3.9.0 #### Arguments 1. `value` *(*)*: The value to compare. 2. `other` *(*)*: The other value to compare. #### Returns *(boolean)*: Returns `true` if `value` is greater than `other`, else `false`. #### Example ```js _.gt(3, 1); // => true _.gt(3, 3); // => false _.gt(1, 3); // => false ``` ---

_.gte(value, other)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11236 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package") [Ⓣ][1] Checks if `value` is greater than or equal to `other`. #### Since 3.9.0 #### Arguments 1. `value` *(*)*: The value to compare. 2. `other` *(*)*: The other value to compare. #### Returns *(boolean)*: Returns `true` if `value` is greater than or equal to `other`, else `false`. #### Example ```js _.gte(3, 1); // => true _.gte(3, 3); // => true _.gte(1, 3); // => false ``` ---

_.isArguments(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11258 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package") [Ⓣ][1] Checks if `value` is likely an `arguments` object. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is an `arguments` object, else `false`. #### Example ```js _.isArguments(function() { return arguments; }()); // => true _.isArguments([1, 2, 3]); // => false ``` ---

_.isArray(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11286 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package") [Ⓣ][1] Checks if `value` is classified as an `Array` object. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is an array, else `false`. #### Example ```js _.isArray([1, 2, 3]); // => true _.isArray(document.body.children); // => false _.isArray('abc'); // => false _.isArray(_.noop); // => false ``` ---

_.isArrayBuffer(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11305 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package") [Ⓣ][1] Checks if `value` is classified as an `ArrayBuffer` object. #### Since 4.3.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is an array buffer, else `false`. #### Example ```js _.isArrayBuffer(new ArrayBuffer(2)); // => true _.isArrayBuffer(new Array(2)); // => false ``` ---

_.isArrayLike(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11332 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package") [Ⓣ][1] Checks if `value` is array-like. A value is considered array-like if it's not a function and has a `value.length` that's an integer greater than or equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is array-like, else `false`. #### Example ```js _.isArrayLike([1, 2, 3]); // => true _.isArrayLike(document.body.children); // => true _.isArrayLike('abc'); // => true _.isArrayLike(_.noop); // => false ``` ---

_.isArrayLikeObject(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11361 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package") [Ⓣ][1] This method is like `_.isArrayLike` except that it also checks if `value` is an object. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is an array-like object, else `false`. #### Example ```js _.isArrayLikeObject([1, 2, 3]); // => true _.isArrayLikeObject(document.body.children); // => true _.isArrayLikeObject('abc'); // => false _.isArrayLikeObject(_.noop); // => false ``` ---

_.isBoolean(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11382 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package") [Ⓣ][1] Checks if `value` is classified as a boolean primitive or object. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a boolean, else `false`. #### Example ```js _.isBoolean(false); // => true _.isBoolean(null); // => false ``` ---

_.isBuffer(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11404 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package") [Ⓣ][1] Checks if `value` is a buffer. #### Since 4.3.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a buffer, else `false`. #### Example ```js _.isBuffer(new Buffer(2)); // => true _.isBuffer(new Uint8Array(2)); // => false ``` ---

_.isDate(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11423 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Date` object. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a date object, else `false`. #### Example ```js _.isDate(new Date); // => true _.isDate('Mon April 23 2012'); // => false ``` ---

_.isElement(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11442 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package") [Ⓣ][1] Checks if `value` is likely a DOM element. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a DOM element, else `false`. #### Example ```js _.isElement(document.body); // => true _.isElement(''); // => false ``` ---

_.isEmpty(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11479 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package") [Ⓣ][1] Checks if `value` is an empty object, collection, map, or set.

Objects are considered empty if they have no own enumerable string keyed properties.

Array-like values such as `arguments` objects, arrays, buffers, strings, or jQuery-like collections are considered empty if they have a `length` of `0`. Similarly, maps and sets are considered empty if they have a `size` of `0`. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is empty, else `false`. #### Example ```js _.isEmpty(null); // => true _.isEmpty(true); // => true _.isEmpty(1); // => true _.isEmpty([1, 2, 3]); // => false _.isEmpty({ 'a': 1 }); // => false ``` ---

_.isEqual(value, other)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11531 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package") [Ⓣ][1] Performs a deep comparison between two values to determine if they are equivalent.

**Note:** This method supports comparing arrays, array buffers, booleans, date objects, error objects, maps, numbers, `Object` objects, regexes, sets, strings, symbols, and typed arrays. `Object` objects are compared by their own, not inherited, enumerable properties. Functions and DOM nodes are compared by strict equality, i.e. `===`. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to compare. 2. `other` *(*)*: The other value to compare. #### Returns *(boolean)*: Returns `true` if the values are equivalent, else `false`. #### Example ```js var object = { 'a': 1 }; var other = { 'a': 1 }; _.isEqual(object, other); // => true object === other; // => false ``` ---

_.isEqualWith(value, other, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11567 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package") [Ⓣ][1] This method is like `_.isEqual` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined`, comparisons are handled by the method instead. The `customizer` is invoked with up to six arguments: *(objValue, othValue [, index|key, object, other, stack])*. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to compare. 2. `other` *(*)*: The other value to compare. 3. `[customizer]` *(Function)*: The function to customize comparisons. #### Returns *(boolean)*: Returns `true` if the values are equivalent, else `false`. #### Example ```js function isGreeting(value) { return /^h(?:i|ello)$/.test(value); } function customizer(objValue, othValue) { if (isGreeting(objValue) && isGreeting(othValue)) { return true; } } var array = ['hello', 'goodbye']; var other = ['hi', 'goodbye']; _.isEqualWith(array, other, customizer); // => true ``` ---

_.isError(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11591 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package") [Ⓣ][1] Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object. #### Since 3.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is an error object, else `false`. #### Example ```js _.isError(new Error); // => true _.isError(Error); // => false ``` ---

_.isFinite(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11626 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package") [Ⓣ][1] Checks if `value` is a finite primitive number.

**Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a finite number, else `false`. #### Example ```js _.isFinite(3); // => true _.isFinite(Number.MIN_VALUE); // => true _.isFinite(Infinity); // => false _.isFinite('3'); // => false ``` ---

_.isFunction(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11647 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Function` object. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a function, else `false`. #### Example ```js _.isFunction(_); // => true _.isFunction(/abc/); // => false ``` ---

_.isInteger(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11683 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package") [Ⓣ][1] Checks if `value` is an integer.

**Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is an integer, else `false`. #### Example ```js _.isInteger(3); // => true _.isInteger(Number.MIN_VALUE); // => false _.isInteger(Infinity); // => false _.isInteger('3'); // => false ``` ---

_.isLength(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11713 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package") [Ⓣ][1] Checks if `value` is a valid array-like length.

**Note:** This method is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a valid length, else `false`. #### Example ```js _.isLength(3); // => true _.isLength(Number.MIN_VALUE); // => false _.isLength(Infinity); // => false _.isLength('3'); // => false ``` ---

_.isMap(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11793 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Map` object. #### Since 4.3.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a map, else `false`. #### Example ```js _.isMap(new Map); // => true _.isMap(new WeakMap); // => false ``` ---

_.isMatch(object, source)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11823 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package") [Ⓣ][1] Performs a partial deep comparison between `object` and `source` to determine if `object` contains equivalent property values.

**Note:** This method is equivalent to `_.matches` when `source` is partially applied.

Partial comparisons will match empty array and empty object `source` values against any array or object value, respectively. See `_.isEqual` for a list of supported value comparisons. #### Since 3.0.0 #### Arguments 1. `object` *(Object)*: The object to inspect. 2. `source` *(Object)*: The object of property values to match. #### Returns *(boolean)*: Returns `true` if `object` is a match, else `false`. #### Example ```js var object = { 'a': 1, 'b': 2 }; _.isMatch(object, { 'b': 2 }); // => true _.isMatch(object, { 'b': 1 }); // => false ``` ---

_.isMatchWith(object, source, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11859 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package") [Ⓣ][1] This method is like `_.isMatch` except that it accepts `customizer` which is invoked to compare values. If `customizer` returns `undefined`, comparisons are handled by the method instead. The `customizer` is invoked with five arguments: *(objValue, srcValue, index|key, object, source)*. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The object to inspect. 2. `source` *(Object)*: The object of property values to match. 3. `[customizer]` *(Function)*: The function to customize comparisons. #### Returns *(boolean)*: Returns `true` if `object` is a match, else `false`. #### Example ```js function isGreeting(value) { return /^h(?:i|ello)$/.test(value); } function customizer(objValue, srcValue) { if (isGreeting(objValue) && isGreeting(srcValue)) { return true; } } var object = { 'greeting': 'hello' }; var source = { 'greeting': 'hi' }; _.isMatchWith(object, source, customizer); // => true ``` ---

_.isNaN(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11892 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package") [Ⓣ][1] Checks if `value` is `NaN`.

**Note:** This method is based on [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as global [`isNaN`](https://mdn.io/isNaN) which returns `true` for `undefined` and other non-number values. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is `NaN`, else `false`. #### Example ```js _.isNaN(NaN); // => true _.isNaN(new Number(NaN)); // => true isNaN(undefined); // => true _.isNaN(undefined); // => false ``` ---

_.isNative(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11925 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package") [Ⓣ][1] Checks if `value` is a pristine native function.

**Note:** This method can't reliably detect native functions in the presence of the core-js package because core-js circumvents this kind of detection. Despite multiple requests, the core-js maintainer has made it clear: any attempt to fix the detection will be obstructed. As a result, we're left with little choice but to throw an error. Unfortunately, this also affects packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), which rely on core-js. #### Since 3.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a native function, else `false`. #### Example ```js _.isNative(Array.prototype.push); // => true _.isNative(_); // => false ``` ---

_.isNil(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11973 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package") [Ⓣ][1] Checks if `value` is `null` or `undefined`. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is nullish, else `false`. #### Example ```js _.isNil(null); // => true _.isNil(void 0); // => true _.isNil(NaN); // => false ``` ---

_.isNull(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11949 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package") [Ⓣ][1] Checks if `value` is `null`. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is `null`, else `false`. #### Example ```js _.isNull(null); // => true _.isNull(void 0); // => false ``` ---

_.isNumber(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12003 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Number` primitive or object.

**Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified as numbers, use the `_.isFinite` method. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a number, else `false`. #### Example ```js _.isNumber(3); // => true _.isNumber(Number.MIN_VALUE); // => true _.isNumber(Infinity); // => true _.isNumber('3'); // => false ``` ---

_.isObject(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11743 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package") [Ⓣ][1] Checks if `value` is the [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) of `Object`. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)* #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is an object, else `false`. #### Example ```js _.isObject({}); // => true _.isObject([1, 2, 3]); // => true _.isObject(_.noop); // => true _.isObject(null); // => false ``` ---

_.isObjectLike(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L11772 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package") [Ⓣ][1] Checks if `value` is object-like. A value is object-like if it's not `null` and has a `typeof` result of "object". #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is object-like, else `false`. #### Example ```js _.isObjectLike({}); // => true _.isObjectLike([1, 2, 3]); // => true _.isObjectLike(_.noop); // => false _.isObjectLike(null); // => false ``` ---

_.isPlainObject(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12036 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package") [Ⓣ][1] Checks if `value` is a plain object, that is, an object created by the `Object` constructor or one with a `[[Prototype]]` of `null`. #### Since 0.8.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a plain object, else `false`. #### Example ```js function Foo() { this.a = 1; } _.isPlainObject(new Foo); // => false _.isPlainObject([1, 2, 3]); // => false _.isPlainObject({ 'x': 0, 'y': 0 }); // => true _.isPlainObject(Object.create(null)); // => true ``` ---

_.isRegExp(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12066 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `RegExp` object. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a regexp, else `false`. #### Example ```js _.isRegExp(/abc/); // => true _.isRegExp('/abc/'); // => false ``` ---

_.isSafeInteger(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12095 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package") [Ⓣ][1] Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer.

**Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a safe integer, else `false`. #### Example ```js _.isSafeInteger(3); // => true _.isSafeInteger(Number.MIN_VALUE); // => false _.isSafeInteger(Infinity); // => false _.isSafeInteger('3'); // => false ``` ---

_.isSet(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12116 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Set` object. #### Since 4.3.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a set, else `false`. #### Example ```js _.isSet(new Set); // => true _.isSet(new WeakSet); // => false ``` ---

_.isString(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12135 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `String` primitive or object. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a string, else `false`. #### Example ```js _.isString('abc'); // => true _.isString(1); // => false ``` ---

_.isSymbol(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12157 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `Symbol` primitive or object. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a symbol, else `false`. #### Example ```js _.isSymbol(Symbol.iterator); // => true _.isSymbol('abc'); // => false ``` ---

_.isTypedArray(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12179 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package") [Ⓣ][1] Checks if `value` is classified as a typed array. #### Since 3.0.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a typed array, else `false`. #### Example ```js _.isTypedArray(new Uint8Array); // => true _.isTypedArray([]); // => false ``` ---

_.isUndefined(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12198 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package") [Ⓣ][1] Checks if `value` is `undefined`. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is `undefined`, else `false`. #### Example ```js _.isUndefined(void 0); // => true _.isUndefined(null); // => false ``` ---

_.isWeakMap(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12219 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `WeakMap` object. #### Since 4.3.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a weak map, else `false`. #### Example ```js _.isWeakMap(new WeakMap); // => true _.isWeakMap(new Map); // => false ``` ---

_.isWeakSet(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12240 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package") [Ⓣ][1] Checks if `value` is classified as a `WeakSet` object. #### Since 4.3.0 #### Arguments 1. `value` *(*)*: The value to check. #### Returns *(boolean)*: Returns `true` if `value` is a weak set, else `false`. #### Example ```js _.isWeakSet(new WeakSet); // => true _.isWeakSet(new Set); // => false ``` ---

_.lt(value, other)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12267 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package") [Ⓣ][1] Checks if `value` is less than `other`. #### Since 3.9.0 #### Arguments 1. `value` *(*)*: The value to compare. 2. `other` *(*)*: The other value to compare. #### Returns *(boolean)*: Returns `true` if `value` is less than `other`, else `false`. #### Example ```js _.lt(1, 3); // => true _.lt(3, 3); // => false _.lt(3, 1); // => false ``` ---

_.lte(value, other)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12292 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package") [Ⓣ][1] Checks if `value` is less than or equal to `other`. #### Since 3.9.0 #### Arguments 1. `value` *(*)*: The value to compare. 2. `other` *(*)*: The other value to compare. #### Returns *(boolean)*: Returns `true` if `value` is less than or equal to `other`, else `false`. #### Example ```js _.lte(1, 3); // => true _.lte(3, 3); // => true _.lte(3, 1); // => false ``` ---

_.toArray(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12319 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package") [Ⓣ][1] Converts `value` to an array. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to convert. #### Returns *(Array)*: Returns the converted array. #### Example ```js _.toArray({ 'a': 1, 'b': 2 }); // => [1, 2] _.toArray('abc'); // => ['a', 'b', 'c'] _.toArray(1); // => [] _.toArray(null); // => [] ``` ---

_.toFinite(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12358 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tofinite "See the npm package") [Ⓣ][1] Converts `value` to a finite number. #### Since 4.12.0 #### Arguments 1. `value` *(*)*: The value to convert. #### Returns *(number)*: Returns the converted number. #### Example ```js _.toFinite(3.2); // => 3.2 _.toFinite(Number.MIN_VALUE); // => 5e-324 _.toFinite(Infinity); // => 1.7976931348623157e+308 _.toFinite('3.2'); // => 3.2 ``` ---

_.toInteger(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12396 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package") [Ⓣ][1] Converts `value` to an integer.

**Note:** This method is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to convert. #### Returns *(number)*: Returns the converted integer. #### Example ```js _.toInteger(3.2); // => 3 _.toInteger(Number.MIN_VALUE); // => 0 _.toInteger(Infinity); // => 1.7976931348623157e+308 _.toInteger('3.2'); // => 3 ``` ---

_.toLength(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12430 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package") [Ⓣ][1] Converts `value` to an integer suitable for use as the length of an array-like object.

**Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to convert. #### Returns *(number)*: Returns the converted integer. #### Example ```js _.toLength(3.2); // => 3 _.toLength(Number.MIN_VALUE); // => 0 _.toLength(Infinity); // => 4294967295 _.toLength('3.2'); // => 3 ``` ---

_.toNumber(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12457 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package") [Ⓣ][1] Converts `value` to a number. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to process. #### Returns *(number)*: Returns the number. #### Example ```js _.toNumber(3.2); // => 3.2 _.toNumber(Number.MIN_VALUE); // => 5e-324 _.toNumber(Infinity); // => Infinity _.toNumber('3.2'); // => 3.2 ``` ---

_.toPlainObject(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12502 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package") [Ⓣ][1] Converts `value` to a plain object flattening inherited enumerable string keyed properties of `value` to own properties of the plain object. #### Since 3.0.0 #### Arguments 1. `value` *(*)*: The value to convert. #### Returns *(Object)*: Returns the converted plain object. #### Example ```js function Foo() { this.b = 2; } Foo.prototype.c = 3; _.assign({ 'a': 1 }, new Foo); // => { 'a': 1, 'b': 2 } _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); // => { 'a': 1, 'b': 2, 'c': 3 } ``` ---

_.toSafeInteger(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12530 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package") [Ⓣ][1] Converts `value` to a safe integer. A safe integer can be compared and represented correctly. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to convert. #### Returns *(number)*: Returns the converted integer. #### Example ```js _.toSafeInteger(3.2); // => 3 _.toSafeInteger(Number.MIN_VALUE); // => 0 _.toSafeInteger(Infinity); // => 9007199254740991 _.toSafeInteger('3.2'); // => 3 ``` ---

_.toString(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12557 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package") [Ⓣ][1] Converts `value` to a string. An empty string is returned for `null` and `undefined` values. The sign of `-0` is preserved. #### Since 4.0.0 #### Arguments 1. `value` *(*)*: The value to convert. #### Returns *(string)*: Returns the converted string. #### Example ```js _.toString(null); // => '' _.toString(-0); // => '-0' _.toString([1, 2, 3]); // => '1,2,3' ``` --- ## `“Math” Methods`

_.add(augend, addend)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16192 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package") [Ⓣ][1] Adds two numbers. #### Since 3.4.0 #### Arguments 1. `augend` *(number)*: The first number in an addition. 2. `addend` *(number)*: The second number in an addition. #### Returns *(number)*: Returns the total. #### Example ```js _.add(6, 4); // => 10 ``` ---

_.ceil(number, [precision=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16217 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package") [Ⓣ][1] Computes `number` rounded up to `precision`. #### Since 3.10.0 #### Arguments 1. `number` *(number)*: The number to round up. 2. `[precision=0]` *(number)*: The precision to round up to. #### Returns *(number)*: Returns the rounded up number. #### Example ```js _.ceil(4.006); // => 5 _.ceil(6.004, 2); // => 6.01 _.ceil(6040, -2); // => 6100 ``` ---

_.divide(dividend, divisor)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16234 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.divide "See the npm package") [Ⓣ][1] Divide two numbers. #### Since 4.7.0 #### Arguments 1. `dividend` *(number)*: The first number in a division. 2. `divisor` *(number)*: The second number in a division. #### Returns *(number)*: Returns the quotient. #### Example ```js _.divide(6, 4); // => 1.5 ``` ---

_.floor(number, [precision=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16259 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package") [Ⓣ][1] Computes `number` rounded down to `precision`. #### Since 3.10.0 #### Arguments 1. `number` *(number)*: The number to round down. 2. `[precision=0]` *(number)*: The precision to round down to. #### Returns *(number)*: Returns the rounded down number. #### Example ```js _.floor(4.006); // => 4 _.floor(0.046, 2); // => 0.04 _.floor(4060, -2); // => 4000 ``` ---

_.max(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16279 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package") [Ⓣ][1] Computes the maximum value of `array`. If `array` is empty or falsey, `undefined` is returned. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. #### Returns *(*)*: Returns the maximum value. #### Example ```js _.max([4, 2, 8, 6]); // => 8 _.max([]); // => undefined ``` ---

_.maxBy(array, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16308 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package") [Ⓣ][1] This method is like `_.max` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: *(value)*. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(*)*: Returns the maximum value. #### Example ```js var objects = [{ 'n': 1 }, { 'n': 2 }]; _.maxBy(objects, function(o) { return o.n; }); // => { 'n': 2 } // The `_.property` iteratee shorthand. _.maxBy(objects, 'n'); // => { 'n': 2 } ``` ---

_.mean(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16328 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package") [Ⓣ][1] Computes the mean of the values in `array`. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. #### Returns *(number)*: Returns the mean. #### Example ```js _.mean([4, 2, 8, 6]); // => 5 ``` ---

_.meanBy(array, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16355 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.meanby "See the npm package") [Ⓣ][1] This method is like `_.mean` except that it accepts `iteratee` which is invoked for each element in `array` to generate the value to be averaged. The iteratee is invoked with one argument: *(value)*. #### Since 4.7.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the mean. #### Example ```js var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; _.meanBy(objects, function(o) { return o.n; }); // => 5 // The `_.property` iteratee shorthand. _.meanBy(objects, 'n'); // => 5 ``` ---

_.min(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16377 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package") [Ⓣ][1] Computes the minimum value of `array`. If `array` is empty or falsey, `undefined` is returned. #### Since 0.1.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. #### Returns *(*)*: Returns the minimum value. #### Example ```js _.min([4, 2, 8, 6]); // => 2 _.min([]); // => undefined ``` ---

_.minBy(array, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16406 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package") [Ⓣ][1] This method is like `_.min` except that it accepts `iteratee` which is invoked for each element in `array` to generate the criterion by which the value is ranked. The iteratee is invoked with one argument: *(value)*. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(*)*: Returns the minimum value. #### Example ```js var objects = [{ 'n': 1 }, { 'n': 2 }]; _.minBy(objects, function(o) { return o.n; }); // => { 'n': 1 } // The `_.property` iteratee shorthand. _.minBy(objects, 'n'); // => { 'n': 1 } ``` ---

_.multiply(multiplier, multiplicand)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16427 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.multiply "See the npm package") [Ⓣ][1] Multiply two numbers. #### Since 4.7.0 #### Arguments 1. `multiplier` *(number)*: The first number in a multiplication. 2. `multiplicand` *(number)*: The second number in a multiplication. #### Returns *(number)*: Returns the product. #### Example ```js _.multiply(6, 4); // => 24 ``` ---

_.round(number, [precision=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16452 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package") [Ⓣ][1] Computes `number` rounded to `precision`. #### Since 3.10.0 #### Arguments 1. `number` *(number)*: The number to round. 2. `[precision=0]` *(number)*: The precision to round to. #### Returns *(number)*: Returns the rounded number. #### Example ```js _.round(4.006); // => 4 _.round(4.006, 2); // => 4.01 _.round(4060, -2); // => 4100 ``` ---

_.subtract(minuend, subtrahend)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16469 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package") [Ⓣ][1] Subtract two numbers. #### Since 4.0.0 #### Arguments 1. `minuend` *(number)*: The first number in a subtraction. 2. `subtrahend` *(number)*: The second number in a subtraction. #### Returns *(number)*: Returns the difference. #### Example ```js _.subtract(6, 4); // => 2 ``` ---

_.sum(array)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16487 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package") [Ⓣ][1] Computes the sum of the values in `array`. #### Since 3.4.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. #### Returns *(number)*: Returns the sum. #### Example ```js _.sum([4, 2, 8, 6]); // => 20 ``` ---

_.sumBy(array, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L16516 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package") [Ⓣ][1] This method is like `_.sum` except that it accepts `iteratee` which is invoked for each element in `array` to generate the value to be summed. The iteratee is invoked with one argument: *(value)*. #### Since 4.0.0 #### Arguments 1. `array` *(Array)*: The array to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(number)*: Returns the sum. #### Example ```js var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; _.sumBy(objects, function(o) { return o.n; }); // => 20 // The `_.property` iteratee shorthand. _.sumBy(objects, 'n'); // => 20 ``` --- ## `“Number” Methods`

_.clamp(number, [lower], upper)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13981 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package") [Ⓣ][1] Clamps `number` within the inclusive `lower` and `upper` bounds. #### Since 4.0.0 #### Arguments 1. `number` *(number)*: The number to clamp. 2. `[lower]` *(number)*: The lower bound. 3. `upper` *(number)*: The upper bound. #### Returns *(number)*: Returns the clamped number. #### Example ```js _.clamp(-10, -5, 5); // => -5 _.clamp(10, -5, 5); // => 5 ``` ---

_.inRange(number, [start=0], end)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14035 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package") [Ⓣ][1] Checks if `n` is between `start` and up to, but not including, `end`. If `end` is not specified, it's set to `start` with `start` then set to `0`. If `start` is greater than `end` the params are swapped to support negative ranges. #### Since 3.3.0 #### Arguments 1. `number` *(number)*: The number to check. 2. `[start=0]` *(number)*: The start of the range. 3. `end` *(number)*: The end of the range. #### Returns *(boolean)*: Returns `true` if `number` is in the range, else `false`. #### Example ```js _.inRange(3, 2, 4); // => true _.inRange(4, 8); // => true _.inRange(4, 2); // => false _.inRange(2, 2); // => false _.inRange(1.2, 2); // => true _.inRange(5.2, 4); // => false _.inRange(-3, -2, -6); // => true ``` ---

_.random([lower=0], [upper=1], [floating])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14078 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package") [Ⓣ][1] Produces a random number between the inclusive `lower` and `upper` bounds. If only one argument is provided a number between `0` and the given number is returned. If `floating` is `true`, or either `lower` or `upper` are floats, a floating-point number is returned instead of an integer.

**Note:** JavaScript follows the IEEE-754 standard for resolving floating-point values which can produce unexpected results. #### Since 0.7.0 #### Arguments 1. `[lower=0]` *(number)*: The lower bound. 2. `[upper=1]` *(number)*: The upper bound. 3. `[floating]` *(boolean)*: Specify returning a floating-point number. #### Returns *(number)*: Returns the random number. #### Example ```js _.random(0, 5); // => an integer between 0 and 5 _.random(5); // => also an integer between 0 and 5 _.random(5, true); // => a floating-point number between 0 and 5 _.random(1.2, 5.2); // => a floating-point number between 1.2 and 5.2 ``` --- ## `“Object” Methods`

_.assign(object, [sources])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12595 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package") [Ⓣ][1] Assigns own enumerable string keyed properties of source objects to the destination object. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

**Note:** This method mutates `object` and is loosely based on [`Object.assign`](https://mdn.io/Object/assign). #### Since 0.10.0 #### Arguments 1. `object` *(Object)*: The destination object. 2. `[sources]` *(...Object)*: The source objects. #### Returns *(Object)*: Returns `object`. #### Example ```js function Foo() { this.a = 1; } function Bar() { this.c = 3; } Foo.prototype.b = 2; Bar.prototype.d = 4; _.assign({ 'a': 0 }, new Foo, new Bar); // => { 'a': 1, 'c': 3 } ``` ---

_.assignIn(object, [sources])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12638 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package") [Ⓣ][1] This method is like `_.assign` except that it iterates over own and inherited source properties.

**Note:** This method mutates `object`. #### Since 4.0.0 #### Aliases *_.extend* #### Arguments 1. `object` *(Object)*: The destination object. 2. `[sources]` *(...Object)*: The source objects. #### Returns *(Object)*: Returns `object`. #### Example ```js function Foo() { this.a = 1; } function Bar() { this.c = 3; } Foo.prototype.b = 2; Bar.prototype.d = 4; _.assignIn({ 'a': 0 }, new Foo, new Bar); // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } ``` ---

_.assignInWith(object, sources, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12671 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package") [Ⓣ][1] This method is like `_.assignIn` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns `undefined`, assignment is handled by the method instead. The `customizer` is invoked with five arguments: *(objValue, srcValue, key, object, source)*.

**Note:** This method mutates `object`. #### Since 4.0.0 #### Aliases *_.extendWith* #### Arguments 1. `object` *(Object)*: The destination object. 2. `sources` *(...Object)*: The source objects. 3. `[customizer]` *(Function)*: The function to customize assigned values. #### Returns *(Object)*: Returns `object`. #### Example ```js function customizer(objValue, srcValue) { return _.isUndefined(objValue) ? srcValue : objValue; } var defaults = _.partialRight(_.assignInWith, customizer); defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); // => { 'a': 1, 'b': 2 } ``` ---

_.assignWith(object, sources, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12703 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package") [Ⓣ][1] This method is like `_.assign` except that it accepts `customizer` which is invoked to produce the assigned values. If `customizer` returns `undefined`, assignment is handled by the method instead. The `customizer` is invoked with five arguments: *(objValue, srcValue, key, object, source)*.

**Note:** This method mutates `object`. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The destination object. 2. `sources` *(...Object)*: The source objects. 3. `[customizer]` *(Function)*: The function to customize assigned values. #### Returns *(Object)*: Returns `object`. #### Example ```js function customizer(objValue, srcValue) { return _.isUndefined(objValue) ? srcValue : objValue; } var defaults = _.partialRight(_.assignWith, customizer); defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); // => { 'a': 1, 'b': 2 } ``` ---

_.at(object, [paths])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12724 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package") [Ⓣ][1] Creates an array of values corresponding to `paths` of `object`. #### Since 1.0.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[paths]` *(...(string|string[]))*: The property paths to pick. #### Returns *(Array)*: Returns the picked values. #### Example ```js var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; _.at(object, ['a[0].b.c', 'a[1]']); // => [3, 4] ``` ---

_.create(prototype, [properties])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12760 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package") [Ⓣ][1] Creates an object that inherits from the `prototype` object. If a `properties` object is given, its own enumerable string keyed properties are assigned to the created object. #### Since 2.3.0 #### Arguments 1. `prototype` *(Object)*: The object to inherit from. 2. `[properties]` *(Object)*: The properties to assign to the object. #### Returns *(Object)*: Returns the new object. #### Example ```js function Shape() { this.x = 0; this.y = 0; } function Circle() { Shape.call(this); } Circle.prototype = _.create(Shape.prototype, { 'constructor': Circle }); var circle = new Circle; circle instanceof Circle; // => true circle instanceof Shape; // => true ``` ---

_.defaults(object, [sources])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12786 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package") [Ⓣ][1] Assigns own and inherited enumerable string keyed properties of source objects to the destination object for all destination properties that resolve to `undefined`. Source objects are applied from left to right. Once a property is set, additional values of the same property are ignored.

**Note:** This method mutates `object`. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The destination object. 2. `[sources]` *(...Object)*: The source objects. #### Returns *(Object)*: Returns `object`. #### Example ```js _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); // => { 'a': 1, 'b': 2 } ``` ---

_.defaultsDeep(object, [sources])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12836 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package") [Ⓣ][1] This method is like `_.defaults` except that it recursively assigns default properties.

**Note:** This method mutates `object`. #### Since 3.10.0 #### Arguments 1. `object` *(Object)*: The destination object. 2. `[sources]` *(...Object)*: The source objects. #### Returns *(Object)*: Returns `object`. #### Example ```js _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); // => { 'a': { 'b': 2, 'c': 3 } } ``` ---

_.findKey(object, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12876 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package") [Ⓣ][1] This method is like `_.find` except that it returns the key of the first element `predicate` returns truthy for instead of the element itself. #### Since 1.1.0 #### Arguments 1. `object` *(Object)*: The object to inspect. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(*)*: Returns the key of the matched element, else `undefined`. #### Example ```js var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age': 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } }; _.findKey(users, function(o) { return o.age < 40; }); // => 'barney' (iteration order is not guaranteed) // The `_.matches` iteratee shorthand. _.findKey(users, { 'age': 1, 'active': true }); // => 'pebbles' // The `_.matchesProperty` iteratee shorthand. _.findKey(users, ['active', false]); // => 'fred' // The `_.property` iteratee shorthand. _.findKey(users, 'active'); // => 'barney' ``` ---

_.findLastKey(object, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12915 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package") [Ⓣ][1] This method is like `_.findKey` except that it iterates over elements of a collection in the opposite order. #### Since 2.0.0 #### Arguments 1. `object` *(Object)*: The object to inspect. 2. `[predicate=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(*)*: Returns the key of the matched element, else `undefined`. #### Example ```js var users = { 'barney': { 'age': 36, 'active': true }, 'fred': { 'age': 40, 'active': false }, 'pebbles': { 'age': 1, 'active': true } }; _.findLastKey(users, function(o) { return o.age < 40; }); // => returns 'pebbles' assuming `_.findKey` returns 'barney' // The `_.matches` iteratee shorthand. _.findLastKey(users, { 'age': 36, 'active': true }); // => 'barney' // The `_.matchesProperty` iteratee shorthand. _.findLastKey(users, ['active', false]); // => 'fred' // The `_.property` iteratee shorthand. _.findLastKey(users, 'active'); // => 'pebbles' ``` ---

_.forIn(object, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12947 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package") [Ⓣ][1] Iterates over own and inherited enumerable string keyed properties of an object and invokes `iteratee` for each property. The iteratee is invoked with three arguments: *(value, key, object)*. Iteratee functions may exit iteration early by explicitly returning `false`. #### Since 0.3.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns `object`. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.forIn(new Foo, function(value, key) { console.log(key); }); // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). ``` ---

_.forInRight(object, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L12979 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package") [Ⓣ][1] This method is like `_.forIn` except that it iterates over properties of `object` in the opposite order. #### Since 2.0.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns `object`. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.forInRight(new Foo, function(value, key) { console.log(key); }); // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. ``` ---

_.forOwn(object, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13013 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package") [Ⓣ][1] Iterates over own enumerable string keyed properties of an object and invokes `iteratee` for each property. The iteratee is invoked with three arguments: *(value, key, object)*. Iteratee functions may exit iteration early by explicitly returning `false`. #### Since 0.3.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns `object`. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.forOwn(new Foo, function(value, key) { console.log(key); }); // => Logs 'a' then 'b' (iteration order is not guaranteed). ``` ---

_.forOwnRight(object, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13043 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package") [Ⓣ][1] This method is like `_.forOwn` except that it iterates over properties of `object` in the opposite order. #### Since 2.0.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns `object`. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.forOwnRight(new Foo, function(value, key) { console.log(key); }); // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. ``` ---

_.functions(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13070 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package") [Ⓣ][1] Creates an array of function property names from own enumerable properties of `object`. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The object to inspect. #### Returns *(Array)*: Returns the function names. #### Example ```js function Foo() { this.a = _.constant('a'); this.b = _.constant('b'); } Foo.prototype.c = _.constant('c'); _.functions(new Foo); // => ['a', 'b'] ``` ---

_.functionsIn(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13097 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package") [Ⓣ][1] Creates an array of function property names from own and inherited enumerable properties of `object`. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The object to inspect. #### Returns *(Array)*: Returns the function names. #### Example ```js function Foo() { this.a = _.constant('a'); this.b = _.constant('b'); } Foo.prototype.c = _.constant('c'); _.functionsIn(new Foo); // => ['a', 'b', 'c'] ``` ---

_.get(object, path, [defaultValue])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13126 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package") [Ⓣ][1] Gets the value at `path` of `object`. If the resolved value is `undefined`, the `defaultValue` is returned in its place. #### Since 3.7.0 #### Arguments 1. `object` *(Object)*: The object to query. 2. `path` *(Array|string)*: The path of the property to get. 3. `[defaultValue]` *(*)*: The value returned for `undefined` resolved values. #### Returns *(*)*: Returns the resolved value. #### Example ```js var object = { 'a': [{ 'b': { 'c': 3 } }] }; _.get(object, 'a[0].b.c'); // => 3 _.get(object, ['a', '0', 'b', 'c']); // => 3 _.get(object, 'a.b.c', 'default'); // => 'default' ``` ---

_.has(object, path)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13158 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package") [Ⓣ][1] Checks if `path` is a direct property of `object`. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The object to query. 2. `path` *(Array|string)*: The path to check. #### Returns *(boolean)*: Returns `true` if `path` exists, else `false`. #### Example ```js var object = { 'a': { 'b': 2 } }; var other = _.create({ 'a': _.create({ 'b': 2 }) }); _.has(object, 'a'); // => true _.has(object, 'a.b'); // => true _.has(object, ['a', 'b']); // => true _.has(other, 'a'); // => false ``` ---

_.hasIn(object, path)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13188 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package") [Ⓣ][1] Checks if `path` is a direct or inherited property of `object`. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The object to query. 2. `path` *(Array|string)*: The path to check. #### Returns *(boolean)*: Returns `true` if `path` exists, else `false`. #### Example ```js var object = _.create({ 'a': _.create({ 'b': 2 }) }); _.hasIn(object, 'a'); // => true _.hasIn(object, 'a.b'); // => true _.hasIn(object, ['a', 'b']); // => true _.hasIn(object, 'b'); // => false ``` ---

_.invert(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13210 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package") [Ⓣ][1] Creates an object composed of the inverted keys and values of `object`. If `object` contains duplicate values, subsequent values overwrite property assignments of previous values. #### Since 0.7.0 #### Arguments 1. `object` *(Object)*: The object to invert. #### Returns *(Object)*: Returns the new inverted object. #### Example ```js var object = { 'a': 1, 'b': 2, 'c': 1 }; _.invert(object); // => { '1': 'c', '2': 'b' } ``` ---

_.invertBy(object, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13245 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package") [Ⓣ][1] This method is like `_.invert` except that the inverted object is generated from the results of running each element of `object` thru `iteratee`. The corresponding inverted value of each inverted key is an array of keys responsible for generating the inverted value. The iteratee is invoked with one argument: *(value)*. #### Since 4.1.0 #### Arguments 1. `object` *(Object)*: The object to invert. 2. `[iteratee=_.identity]` *(Function)*: The iteratee invoked per element. #### Returns *(Object)*: Returns the new inverted object. #### Example ```js var object = { 'a': 1, 'b': 2, 'c': 1 }; _.invertBy(object); // => { '1': ['a', 'c'], '2': ['b'] } _.invertBy(object, function(value) { return 'group' + value; }); // => { 'group1': ['a', 'c'], 'group2': ['b'] } ``` ---

_.invoke(object, path, [args])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13276 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package") [Ⓣ][1] Invokes the method at `path` of `object`. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The object to query. 2. `path` *(Array|string)*: The path of the method to invoke. 3. `[args]` *(...*)*: The arguments to invoke the method with. #### Returns *(*)*: Returns the result of the invoked method. #### Example ```js var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; _.invoke(object, 'a[0].b.c.slice', 1, 3); // => [2, 3] ``` ---

_.keys(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13306 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package") [Ⓣ][1] Creates an array of the own enumerable property names of `object`.

**Note:** Non-object values are coerced to objects. See the [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) for more details. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The object to query. #### Returns *(Array)*: Returns the array of property names. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.keys(new Foo); // => ['a', 'b'] (iteration order is not guaranteed) _.keys('hi'); // => ['0', '1'] ``` ---

_.keysIn(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13333 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package") [Ⓣ][1] Creates an array of the own and inherited enumerable property names of `object`.

**Note:** Non-object values are coerced to objects. #### Since 3.0.0 #### Arguments 1. `object` *(Object)*: The object to query. #### Returns *(Array)*: Returns the array of property names. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.keysIn(new Foo); // => ['a', 'b', 'c'] (iteration order is not guaranteed) ``` ---

_.mapKeys(object, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13358 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package") [Ⓣ][1] The opposite of `_.mapValues`; this method creates an object with the same values as `object` and keys generated by running each own enumerable string keyed property of `object` thru `iteratee`. The iteratee is invoked with three arguments: *(value, key, object)*. #### Since 3.8.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns the new mapped object. #### Example ```js _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { return key + value; }); // => { 'a1': 1, 'b2': 2 } ``` ---

_.mapValues(object, [iteratee=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13396 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package") [Ⓣ][1] Creates an object with the same keys as `object` and values generated by running each own enumerable string keyed property of `object` thru `iteratee`. The iteratee is invoked with three arguments:
*(value, key, object)*. #### Since 2.4.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. #### Returns *(Object)*: Returns the new mapped object. #### Example ```js var users = { 'fred': { 'user': 'fred', 'age': 40 }, 'pebbles': { 'user': 'pebbles', 'age': 1 } }; _.mapValues(users, function(o) { return o.age; }); // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) // The `_.property` iteratee shorthand. _.mapValues(users, 'age'); // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) ``` ---

_.merge(object, [sources])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13437 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package") [Ⓣ][1] This method is like `_.assign` except that it recursively merges own and inherited enumerable string keyed properties of source objects into the destination object. Source properties that resolve to `undefined` are skipped if a destination value exists. Array and plain object properties are merged recursively. Other objects and value types are overridden by assignment. Source objects are applied from left to right. Subsequent sources overwrite property assignments of previous sources.

**Note:** This method mutates `object`. #### Since 0.5.0 #### Arguments 1. `object` *(Object)*: The destination object. 2. `[sources]` *(...Object)*: The source objects. #### Returns *(Object)*: Returns `object`. #### Example ```js var object = { 'a': [{ 'b': 2 }, { 'd': 4 }] }; var other = { 'a': [{ 'c': 3 }, { 'e': 5 }] }; _.merge(object, other); // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } ``` ---

_.mergeWith(object, sources, customizer)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13472 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package") [Ⓣ][1] This method is like `_.merge` except that it accepts `customizer` which is invoked to produce the merged values of the destination and source properties. If `customizer` returns `undefined`, merging is handled by the method instead. The `customizer` is invoked with six arguments:
*(objValue, srcValue, key, object, source, stack)*.

**Note:** This method mutates `object`. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The destination object. 2. `sources` *(...Object)*: The source objects. 3. `customizer` *(Function)*: The function to customize assigned values. #### Returns *(Object)*: Returns `object`. #### Example ```js function customizer(objValue, srcValue) { if (_.isArray(objValue)) { return objValue.concat(srcValue); } } var object = { 'a': [1], 'b': [2] }; var other = { 'a': [3], 'b': [4] }; _.mergeWith(object, other, customizer); // => { 'a': [1, 3], 'b': [2, 4] } ``` ---

_.omit(object, [paths])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13496 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package") [Ⓣ][1] The opposite of `_.pick`; this method creates an object composed of the own and inherited enumerable property paths of `object` that are not omitted.

**Note:** This method is considerably slower than `_.pick`. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The source object. 2. `[paths]` *(...(string|string[]))*: The property paths to omit. #### Returns *(Object)*: Returns the new object. #### Example ```js var object = { 'a': 1, 'b': '2', 'c': 3 }; _.omit(object, ['a', 'c']); // => { 'b': '2' } ``` ---

_.omitBy(object, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13538 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package") [Ⓣ][1] The opposite of `_.pickBy`; this method creates an object composed of the own and inherited enumerable string keyed properties of `object` that `predicate` doesn't return truthy for. The predicate is invoked with two arguments: *(value, key)*. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The source object. 2. `[predicate=_.identity]` *(Function)*: The function invoked per property. #### Returns *(Object)*: Returns the new object. #### Example ```js var object = { 'a': 1, 'b': '2', 'c': 3 }; _.omitBy(object, _.isNumber); // => { 'b': '2' } ``` ---

_.pick(object, [paths])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13559 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package") [Ⓣ][1] Creates an object composed of the picked `object` properties. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The source object. 2. `[paths]` *(...(string|string[]))*: The property paths to pick. #### Returns *(Object)*: Returns the new object. #### Example ```js var object = { 'a': 1, 'b': '2', 'c': 3 }; _.pick(object, ['a', 'c']); // => { 'a': 1, 'c': 3 } ``` ---

_.pickBy(object, [predicate=_.identity])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13581 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package") [Ⓣ][1] Creates an object composed of the `object` properties `predicate` returns truthy for. The predicate is invoked with two arguments: *(value, key)*. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The source object. 2. `[predicate=_.identity]` *(Function)*: The function invoked per property. #### Returns *(Object)*: Returns the new object. #### Example ```js var object = { 'a': 1, 'b': '2', 'c': 3 }; _.pickBy(object, _.isNumber); // => { 'a': 1, 'c': 3 } ``` ---

_.result(object, path, [defaultValue])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13623 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package") [Ⓣ][1] This method is like `_.get` except that if the resolved value is a function it's invoked with the `this` binding of its parent object and its result is returned. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The object to query. 2. `path` *(Array|string)*: The path of the property to resolve. 3. `[defaultValue]` *(*)*: The value returned for `undefined` resolved values. #### Returns *(*)*: Returns the resolved value. #### Example ```js var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; _.result(object, 'a[0].b.c1'); // => 3 _.result(object, 'a[0].b.c2'); // => 4 _.result(object, 'a[0].b.c3', 'default'); // => 'default' _.result(object, 'a[0].b.c3', _.constant('default')); // => 'default' ``` ---

_.set(object, path, value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13673 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package") [Ⓣ][1] Sets the value at `path` of `object`. If a portion of `path` doesn't exist, it's created. Arrays are created for missing index properties while objects are created for all other missing properties. Use `_.setWith` to customize `path` creation.

**Note:** This method mutates `object`. #### Since 3.7.0 #### Arguments 1. `object` *(Object)*: The object to modify. 2. `path` *(Array|string)*: The path of the property to set. 3. `value` *(*)*: The value to set. #### Returns *(Object)*: Returns `object`. #### Example ```js var object = { 'a': [{ 'b': { 'c': 3 } }] }; _.set(object, 'a[0].b.c', 4); console.log(object.a[0].b.c); // => 4 _.set(object, ['x', '0', 'y', 'z'], 5); console.log(object.x[0].y.z); // => 5 ``` ---

_.setWith(object, path, value, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13701 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package") [Ⓣ][1] This method is like `_.set` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` path creation is handled by the method instead. The `customizer` is invoked with three arguments: *(nsValue, key, nsObject)*.

**Note:** This method mutates `object`. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The object to modify. 2. `path` *(Array|string)*: The path of the property to set. 3. `value` *(*)*: The value to set. 4. `[customizer]` *(Function)*: The function to customize assigned values. #### Returns *(Object)*: Returns `object`. #### Example ```js var object = {}; _.setWith(object, '[0][1]', 'a', Object); // => { '0': { '1': 'a' } } ``` ---

_.toPairs(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13730 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package") [Ⓣ][1] Creates an array of own enumerable string keyed-value pairs for `object` which can be consumed by `_.fromPairs`. If `object` is a map or set, its entries are returned. #### Since 4.0.0 #### Aliases *_.entries* #### Arguments 1. `object` *(Object)*: The object to query. #### Returns *(Array)*: Returns the key-value pairs. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.toPairs(new Foo); // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) ``` ---

_.toPairsIn(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13756 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package") [Ⓣ][1] Creates an array of own and inherited enumerable string keyed-value pairs for `object` which can be consumed by `_.fromPairs`. If `object` is a map or set, its entries are returned. #### Since 4.0.0 #### Aliases *_.entriesIn* #### Arguments 1. `object` *(Object)*: The object to query. #### Returns *(Array)*: Returns the key-value pairs. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.toPairsIn(new Foo); // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) ``` ---

_.transform(object, [iteratee=_.identity], [accumulator])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13788 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package") [Ⓣ][1] An alternative to `_.reduce`; this method transforms `object` to a new `accumulator` object which is the result of running each of its own enumerable string keyed properties thru `iteratee`, with each invocation potentially mutating the `accumulator` object. If `accumulator` is not provided, a new object with the same `[[Prototype]]` will be used. The iteratee is invoked with four arguments: *(accumulator, value, key, object)*. Iteratee functions may exit iteration early by explicitly returning `false`. #### Since 1.3.0 #### Arguments 1. `object` *(Object)*: The object to iterate over. 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration. 3. `[accumulator]` *(*)*: The custom accumulator value. #### Returns *(*)*: Returns the accumulated value. #### Example ```js _.transform([2, 3, 4], function(result, n) { result.push(n *= n); return n % 2 == 0; }, []); // => [4, 9] _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { (result[value] || (result[value] = [])).push(key); }, {}); // => { '1': ['a', 'c'], '2': ['b'] } ``` ---

_.unset(object, path)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13838 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package") [Ⓣ][1] Removes the property at `path` of `object`.

**Note:** This method mutates `object`. #### Since 4.0.0 #### Arguments 1. `object` *(Object)*: The object to modify. 2. `path` *(Array|string)*: The path of the property to unset. #### Returns *(boolean)*: Returns `true` if the property is deleted, else `false`. #### Example ```js var object = { 'a': [{ 'b': { 'c': 7 } }] }; _.unset(object, 'a[0].b.c'); // => true console.log(object); // => { 'a': [{ 'b': {} }] }; _.unset(object, ['a', '0', 'b', 'c']); // => true console.log(object); // => { 'a': [{ 'b': {} }] }; ``` ---

_.update(object, path, updater)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13869 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.update "See the npm package") [Ⓣ][1] This method is like `_.set` except that accepts `updater` to produce the value to set. Use `_.updateWith` to customize `path` creation. The `updater` is invoked with one argument: *(value)*.

**Note:** This method mutates `object`. #### Since 4.6.0 #### Arguments 1. `object` *(Object)*: The object to modify. 2. `path` *(Array|string)*: The path of the property to set. 3. `updater` *(Function)*: The function to produce the updated value. #### Returns *(Object)*: Returns `object`. #### Example ```js var object = { 'a': [{ 'b': { 'c': 3 } }] }; _.update(object, 'a[0].b.c', function(n) { return n * n; }); console.log(object.a[0].b.c); // => 9 _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); console.log(object.x[0].y.z); // => 0 ``` ---

_.updateWith(object, path, updater, [customizer])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13897 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.updatewith "See the npm package") [Ⓣ][1] This method is like `_.update` except that it accepts `customizer` which is invoked to produce the objects of `path`. If `customizer` returns `undefined` path creation is handled by the method instead. The `customizer` is invoked with three arguments: *(nsValue, key, nsObject)*.

**Note:** This method mutates `object`. #### Since 4.6.0 #### Arguments 1. `object` *(Object)*: The object to modify. 2. `path` *(Array|string)*: The path of the property to set. 3. `updater` *(Function)*: The function to produce the updated value. 4. `[customizer]` *(Function)*: The function to customize assigned values. #### Returns *(Object)*: Returns `object`. #### Example ```js var object = {}; _.updateWith(object, '[0][1]', _.constant('a'), Object); // => { '0': { '1': 'a' } } ``` ---

_.values(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13928 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package") [Ⓣ][1] Creates an array of the own enumerable string keyed property values of `object`.

**Note:** Non-object values are coerced to objects. #### Since 0.1.0 #### Arguments 1. `object` *(Object)*: The object to query. #### Returns *(Array)*: Returns the array of property values. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.values(new Foo); // => [1, 2] (iteration order is not guaranteed) _.values('hi'); // => ['h', 'i'] ``` ---

_.valuesIn(object)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L13956 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package") [Ⓣ][1] Creates an array of the own and inherited enumerable string keyed property values of `object`.

**Note:** Non-object values are coerced to objects. #### Since 3.0.0 #### Arguments 1. `object` *(Object)*: The object to query. #### Returns *(Array)*: Returns the array of property values. #### Example ```js function Foo() { this.a = 1; this.b = 2; } Foo.prototype.c = 3; _.valuesIn(new Foo); // => [1, 2, 3] (iteration order is not guaranteed) ``` --- ## `“Seq” Methods`

_(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L1648 "View in source") [Ⓣ][1] Creates a `lodash` object which wraps `value` to enable implicit method chain sequences. Methods that operate on and return arrays, collections, and functions can be chained together. Methods that retrieve a single value or may return a primitive value will automatically end the chain sequence and return the unwrapped value. Otherwise, the value must be unwrapped with `_#value`.

Explicit chain sequences, which must be unwrapped with `_#value`, may be enabled using `_.chain`.

The execution of chained methods is lazy, that is, it's deferred until `_#value` is implicitly or explicitly called.

Lazy evaluation allows several methods to support shortcut fusion. Shortcut fusion is an optimization to merge iteratee calls; this avoids the creation of intermediate arrays and can greatly reduce the number of iteratee executions. Sections of a chain sequence qualify for shortcut fusion if the section is applied to an array and iteratees accept only one argument. The heuristic for whether a section qualifies for shortcut fusion is subject to change.

Chaining is supported in custom builds as long as the `_#value` method is directly or indirectly included in the build.

In addition to lodash methods, wrappers have `Array` and `String` methods.

The wrapper `Array` methods are:
`concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`

The wrapper `String` methods are:
`replace` and `split`

The wrapper methods that support shortcut fusion are:
`at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`

The chainable wrapper methods are:
`after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, `zipObject`, `zipObjectDeep`, and `zipWith`

The wrapper methods that are **not** chainable by default are:
`add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` #### Arguments 1. `value` *(*)*: The value to wrap in a `lodash` instance. #### Returns *(Object)*: Returns the new `lodash` wrapper instance. #### Example ```js function square(n) { return n * n; } var wrapped = _([1, 2, 3]); // Returns an unwrapped value. wrapped.reduce(_.add); // => 6 // Returns a wrapped value. var squares = wrapped.map(square); _.isArray(squares); // => false _.isArray(squares.value()); // => true ``` ---

_.chain(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8737 "View in source") [Ⓣ][1] Creates a `lodash` wrapper instance that wraps `value` with explicit method chain sequences enabled. The result of such sequences must be unwrapped with `_#value`. #### Since 1.3.0 #### Arguments 1. `value` *(*)*: The value to wrap. #### Returns *(Object)*: Returns the new `lodash` wrapper instance. #### Example ```js var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }, { 'user': 'pebbles', 'age': 1 } ]; var youngest = _ .chain(users) .sortBy('age') .map(function(o) { return o.user + ' is ' + o.age; }) .head() .value(); // => 'pebbles is 1' ``` ---

_.tap(value, interceptor)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8766 "View in source") [Ⓣ][1] This method invokes `interceptor` and returns `value`. The interceptor is invoked with one argument; *(value)*. The purpose of this method is to "tap into" a method chain sequence in order to modify intermediate results. #### Since 0.1.0 #### Arguments 1. `value` *(*)*: The value to provide to `interceptor`. 2. `interceptor` *(Function)*: The function to invoke. #### Returns *(*)*: Returns `value`. #### Example ```js _([1, 2, 3]) .tap(function(array) { // Mutate input array. array.pop(); }) .reverse() .value(); // => [2, 1] ``` ---

_.thru(value, interceptor)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8794 "View in source") [Ⓣ][1] This method is like `_.tap` except that it returns the result of `interceptor`. The purpose of this method is to "pass thru" values replacing intermediate results in a method chain sequence. #### Since 3.0.0 #### Arguments 1. `value` *(*)*: The value to provide to `interceptor`. 2. `interceptor` *(Function)*: The function to invoke. #### Returns *(*)*: Returns the result of `interceptor`. #### Example ```js _(' abc ') .chain() .trim() .thru(function(value) { return [value]; }) .value(); // => ['abc'] ``` ---

_.prototype[Symbol.iterator]()

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8949 "View in source") [Ⓣ][1] Enables the wrapper to be iterable. #### Since 4.0.0 #### Returns *(Object)*: Returns the wrapper object. #### Example ```js var wrapped = _([1, 2]); wrapped[Symbol.iterator]() === wrapped; // => true Array.from(wrapped); // => [1, 2] ``` ---

_.prototype.at([paths])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8814 "View in source") [Ⓣ][1] This method is the wrapper version of `_.at`. #### Since 1.0.0 #### Arguments 1. `[paths]` *(...(string|string[]))*: The property paths to pick. #### Returns *(Object)*: Returns the new `lodash` wrapper instance. #### Example ```js var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; _(object).at(['a[0].b.c', 'a[1]']).value(); // => [3, 4] ``` ---

_.prototype.chain()

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8865 "View in source") [Ⓣ][1] Creates a `lodash` wrapper instance with explicit method chain sequences enabled. #### Since 0.1.0 #### Returns *(Object)*: Returns the new `lodash` wrapper instance. #### Example ```js var users = [ { 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 } ]; // A sequence without explicit chaining. _(users).head(); // => { 'user': 'barney', 'age': 36 } // A sequence with explicit chaining. _(users) .chain() .head() .pick('user') .value(); // => { 'user': 'barney' } ``` ---

_.prototype.commit()

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8895 "View in source") [Ⓣ][1] Executes the chain sequence and returns the wrapped result. #### Since 3.2.0 #### Returns *(Object)*: Returns the new `lodash` wrapper instance. #### Example ```js var array = [1, 2]; var wrapped = _(array).push(3); console.log(array); // => [1, 2] wrapped = wrapped.commit(); console.log(array); // => [1, 2, 3] wrapped.last(); // => 3 console.log(array); // => [1, 2, 3] ``` ---

_.prototype.next()

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8921 "View in source") [Ⓣ][1] Gets the next value on a wrapped object following the [iterator protocol](https://mdn.io/iteration_protocols#iterator). #### Since 4.0.0 #### Returns *(Object)*: Returns the next iterator value. #### Example ```js var wrapped = _([1, 2]); wrapped.next(); // => { 'done': false, 'value': 1 } wrapped.next(); // => { 'done': false, 'value': 2 } wrapped.next(); // => { 'done': true, 'value': undefined } ``` ---

_.prototype.plant(value)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L8977 "View in source") [Ⓣ][1] Creates a clone of the chain sequence planting `value` as the wrapped value. #### Since 3.2.0 #### Arguments 1. `value` *(*)*: The value to plant. #### Returns *(Object)*: Returns the new `lodash` wrapper instance. #### Example ```js function square(n) { return n * n; } var wrapped = _([1, 2]).map(square); var other = wrapped.plant([3, 4]); other.value(); // => [9, 16] wrapped.value(); // => [1, 4] ``` ---

_.prototype.reverse()

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9017 "View in source") [Ⓣ][1] This method is the wrapper version of `_.reverse`.

**Note:** This method mutates the wrapped array. #### Since 0.1.0 #### Returns *(Object)*: Returns the new `lodash` wrapper instance. #### Example ```js var array = [1, 2, 3]; _(array).reverse().value() // => [3, 2, 1] console.log(array); // => [3, 2, 1] ``` ---

_.prototype.value()

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L9049 "View in source") [Ⓣ][1] Executes the chain sequence to resolve the unwrapped value. #### Since 0.1.0 #### Aliases *_.prototype.toJSON, _.prototype.valueOf* #### Returns *(*)*: Returns the resolved unwrapped value. #### Example ```js _([1, 2, 3]).value(); // => [1, 2, 3] ``` --- ## `“String” Methods`

_.camelCase([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14139 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package") [Ⓣ][1] Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to convert. #### Returns *(string)*: Returns the camel cased string. #### Example ```js _.camelCase('Foo Bar'); // => 'fooBar' _.camelCase('--foo-bar--'); // => 'fooBar' _.camelCase('__FOO_BAR__'); // => 'fooBar' ``` ---

_.capitalize([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14159 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package") [Ⓣ][1] Converts the first character of `string` to upper case and the remaining to lower case. #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to capitalize. #### Returns *(string)*: Returns the capitalized string. #### Example ```js _.capitalize('FRED'); // => 'Fred' ``` ---

_.deburr([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14181 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package") [Ⓣ][1] Deburrs `string` by converting [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) letters to basic Latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to deburr. #### Returns *(string)*: Returns the deburred string. #### Example ```js _.deburr('déjà vu'); // => 'deja vu' ``` ---

_.endsWith([string=''], [target], [position=string.length])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14209 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package") [Ⓣ][1] Checks if `string` ends with the given target string. #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to inspect. 2. `[target]` *(string)*: The string to search for. 3. `[position=string.length]` *(number)*: The position to search up to. #### Returns *(boolean)*: Returns `true` if `string` ends with `target`, else `false`. #### Example ```js _.endsWith('abc', 'c'); // => true _.endsWith('abc', 'b'); // => false _.endsWith('abc', 'b', 2); // => true ``` ---

_.escape([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14251 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package") [Ⓣ][1] Converts the characters "&", "<", ">", '"', and "'" in `string` to their corresponding HTML entities.

**Note:** No other characters are escaped. To escape additional characters use a third-party library like [_he_](https://mths.be/he).

Though the ">" character is escaped for symmetry, characters like ">" and "/" don't need escaping in HTML and have no special meaning unless they're part of a tag or unquoted attribute value. See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) *(under "semi-related fun fact")* for more details.

When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping) to reduce XSS vectors. #### Since 0.1.0 #### Arguments 1. `[string='']` *(string)*: The string to escape. #### Returns *(string)*: Returns the escaped string. #### Example ```js _.escape('fred, barney, & pebbles'); // => 'fred, barney, & pebbles' ``` ---

_.escapeRegExp([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14273 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package") [Ⓣ][1] Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to escape. #### Returns *(string)*: Returns the escaped string. #### Example ```js _.escapeRegExp('[lodash](https://lodash.com/)'); // => '\[lodash\]\(https://lodash\.com/\)' ``` ---

_.kebabCase([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14301 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package") [Ⓣ][1] Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to convert. #### Returns *(string)*: Returns the kebab cased string. #### Example ```js _.kebabCase('Foo Bar'); // => 'foo-bar' _.kebabCase('fooBar'); // => 'foo-bar' _.kebabCase('__FOO_BAR__'); // => 'foo-bar' ``` ---

_.lowerCase([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14325 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package") [Ⓣ][1] Converts `string`, as space separated words, to lower case. #### Since 4.0.0 #### Arguments 1. `[string='']` *(string)*: The string to convert. #### Returns *(string)*: Returns the lower cased string. #### Example ```js _.lowerCase('--Foo-Bar--'); // => 'foo bar' _.lowerCase('fooBar'); // => 'foo bar' _.lowerCase('__FOO_BAR__'); // => 'foo bar' ``` ---

_.lowerFirst([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14346 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package") [Ⓣ][1] Converts the first character of `string` to lower case. #### Since 4.0.0 #### Arguments 1. `[string='']` *(string)*: The string to convert. #### Returns *(string)*: Returns the converted string. #### Example ```js _.lowerFirst('Fred'); // => 'fred' _.lowerFirst('FRED'); // => 'fRED' ``` ---

_.pad([string=''], [length=0], [chars=' '])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14371 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package") [Ⓣ][1] Pads `string` on the left and right sides if it's shorter than `length`. Padding characters are truncated if they can't be evenly divided by `length`. #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to pad. 2. `[length=0]` *(number)*: The padding length. 3. `[chars=' ']` *(string)*: The string used as padding. #### Returns *(string)*: Returns the padded string. #### Example ```js _.pad('abc', 8); // => ' abc ' _.pad('abc', 8, '_-'); // => '_-abc_-_' _.pad('abc', 3); // => 'abc' ``` ---

_.padEnd([string=''], [length=0], [chars=' '])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14410 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package") [Ⓣ][1] Pads `string` on the right side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. #### Since 4.0.0 #### Arguments 1. `[string='']` *(string)*: The string to pad. 2. `[length=0]` *(number)*: The padding length. 3. `[chars=' ']` *(string)*: The string used as padding. #### Returns *(string)*: Returns the padded string. #### Example ```js _.padEnd('abc', 6); // => 'abc ' _.padEnd('abc', 6, '_-'); // => 'abc_-_' _.padEnd('abc', 3); // => 'abc' ``` ---

_.padStart([string=''], [length=0], [chars=' '])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14443 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package") [Ⓣ][1] Pads `string` on the left side if it's shorter than `length`. Padding characters are truncated if they exceed `length`. #### Since 4.0.0 #### Arguments 1. `[string='']` *(string)*: The string to pad. 2. `[length=0]` *(number)*: The padding length. 3. `[chars=' ']` *(string)*: The string used as padding. #### Returns *(string)*: Returns the padded string. #### Example ```js _.padStart('abc', 6); // => ' abc' _.padStart('abc', 6, '_-'); // => '_-_abc' _.padStart('abc', 3); // => 'abc' ``` ---

_.parseInt(string, [radix=10])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14477 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package") [Ⓣ][1] Converts `string` to an integer of the specified radix. If `radix` is `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal, in which case a `radix` of `16` is used.

**Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. #### Since 1.1.0 #### Arguments 1. `string` *(string)*: The string to convert. 2. `[radix=10]` *(number)*: The radix to interpret `value` by. #### Returns *(number)*: Returns the converted integer. #### Example ```js _.parseInt('08'); // => 8 _.map(['6', '08', '10'], _.parseInt); // => [6, 8, 10] ``` ---

_.repeat([string=''], [n=1])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14508 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package") [Ⓣ][1] Repeats the given string `n` times. #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to repeat. 2. `[n=1]` *(number)*: The number of times to repeat the string. #### Returns *(string)*: Returns the repeated string. #### Example ```js _.repeat('*', 3); // => '***' _.repeat('abc', 2); // => 'abcabc' _.repeat('abc', 0); // => '' ``` ---

_.replace([string=''], pattern, replacement)

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14536 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package") [Ⓣ][1] Replaces matches for `pattern` in `string` with `replacement`.

**Note:** This method is based on [`String#replace`](https://mdn.io/String/replace). #### Since 4.0.0 #### Arguments 1. `[string='']` *(string)*: The string to modify. 2. `pattern` *(RegExp|string)*: The pattern to replace. 3. `replacement` *(Function|string)*: The match replacement. #### Returns *(string)*: Returns the modified string. #### Example ```js _.replace('Hi Fred', 'Fred', 'Barney'); // => 'Hi Barney' ``` ---

_.snakeCase([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14564 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package") [Ⓣ][1] Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case). #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to convert. #### Returns *(string)*: Returns the snake cased string. #### Example ```js _.snakeCase('Foo Bar'); // => 'foo_bar' _.snakeCase('fooBar'); // => 'foo_bar' _.snakeCase('--FOO-BAR--'); // => 'foo_bar' ``` ---

_.split([string=''], separator, [limit])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14587 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package") [Ⓣ][1] Splits `string` by `separator`.

**Note:** This method is based on [`String#split`](https://mdn.io/String/split). #### Since 4.0.0 #### Arguments 1. `[string='']` *(string)*: The string to split. 2. `separator` *(RegExp|string)*: The separator pattern to split by. 3. `[limit]` *(number)*: The length to truncate results to. #### Returns *(Array)*: Returns the string segments. #### Example ```js _.split('a-b-c', '-', 2); // => ['a', 'b'] ``` ---

_.startCase([string=''])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14629 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package") [Ⓣ][1] Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). #### Since 3.1.0 #### Arguments 1. `[string='']` *(string)*: The string to convert. #### Returns *(string)*: Returns the start cased string. #### Example ```js _.startCase('--foo-bar--'); // => 'Foo Bar' _.startCase('fooBar'); // => 'Foo Bar' _.startCase('__FOO_BAR__'); // => 'FOO BAR' ``` ---

_.startsWith([string=''], [target], [position=0])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14656 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package") [Ⓣ][1] Checks if `string` starts with the given target string. #### Since 3.0.0 #### Arguments 1. `[string='']` *(string)*: The string to inspect. 2. `[target]` *(string)*: The string to search for. 3. `[position=0]` *(number)*: The position to search from. #### Returns *(boolean)*: Returns `true` if `string` starts with `target`, else `false`. #### Example ```js _.startsWith('abc', 'a'); // => true _.startsWith('abc', 'b'); // => false _.startsWith('abc', 'b', 1); // => true ``` ---

_.template([string=''], [options={}])

[Ⓢ](https://github.com/lodash/lodash/blob/4.17.15/lodash.js#L14770 "View in source") [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package") [Ⓣ][1] Creates a compiled template function that can interpolate data properties in "interpolate" delimiters, HTML-escape interpolated data properties in "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data properties may be accessed as free variables in the template. If a setting object is given, it takes precedence over `_.templateSettings` values.

**Note:** In the development build `_.template` utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging.

For more information on precompiling templates see [lodash's custom builds documentation](https://lodash.com/custom-builds).

For more information on Chrome extension sandboxes see [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). #### Since 0.1.0 #### Arguments 1. `[string='']` *(string)*: The template string. 2. `[options={}]` *(Object)*: The options object. 3. `[options.escape=_.templateSettings.escape]` *(RegExp)*: The HTML "escape" delimiter. 4. `[options.evaluate=_.templateSettings.evaluate]` *(RegExp)*: The "evaluate" delimiter. 5. `[options.imports=_.templateSettings.imports]` *(Object)*: An object to import into the template as free variables. 6. `[options.interpolate=_.templateSettings.interpolate]` *(RegExp)*: The "interpolate" delimiter. 7. `[options.sourceURL='lodash.templateSources[n]']` *(string)*: The sourceURL of the compiled template. 8. `[options.variable='obj']` *(string)*: The data object variable name. #### Returns *(Function)*: Returns the compiled template function. #### Example ```js // Use the "interpolate" delimiter to create a compiled template. var compiled = _.template('hello <%= user %>!'); compiled({ 'user': 'fred' }); // => 'hello fred!' // Use the HTML "escape" delimiter to escape data property values. var compiled = _.template('<%- value %>'); compiled({ 'value': '