diff --git a/VERSION.html b/VERSION.html index a2500ba..8ddffe2 100644 --- a/VERSION.html +++ b/VERSION.html @@ -392,7 +392,7 @@
-

VERSION source

+

VERSION source

_.VERSION

(string): The semantic version number.

diff --git a/_.html b/_.html index 7d1c537..11d6831 100644 --- a/_.html +++ b/_.html @@ -392,7 +392,7 @@
-

_ source

+

_ source

_(value)

Creates a lodash object which wraps value to enable implicit method diff --git a/add.html b/add.html index f8578fb..490f2f7 100644 --- a/add.html +++ b/add.html @@ -392,7 +392,7 @@

-

add source npm

+

add source npm

_.add(augend, addend)

Adds two numbers.

diff --git a/after.html b/after.html index 5057564..863b504 100644 --- a/after.html +++ b/after.html @@ -392,7 +392,7 @@
-

after source npm

+

after source npm

_.after(n, func)

The opposite of _.before; this method creates a function that invokes diff --git a/all.html b/all.html index b839643..8079cca 100644 --- a/all.html +++ b/all.html @@ -591,11 +591,11 @@

兼容性

-V, --version ......... 显示当前的 lodash 版本号
-

chunk source npm

+

chunk source npm

_.chunk(array, [size=0])
-

将 array 拆分成多个 size 长度的块,并组成一个新数组。 -如果 array 无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。

+

将数组拆分成多个 size 长度的块,并组成一个新数组。 +如果数组无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。

参数

@@ -617,20 +617,20 @@

示例

-

compact source npm

+

compact source npm

_.compact(array)
-

Creates an array with all falsey values removed. The values false, null, -0, "", undefined, and NaN are falsey.

+

创建一个移除了所有假值的数组。例如:falsenull、 +0""undefined, 以及NaN 都是 “假值”.

参数

    -
  1. array (Array)

    The array to compact.

    +
  2. array (Array)

    需要被处理的数组。

返回值 (Array)

-

Returns the new array of filtered values.

+

返回移除了假值的数组。

示例

_.compact([0, 1, false, 2, '', 3]);
@@ -638,22 +638,21 @@ 

示例

-

concat source npm

+

concat source npm

_.concat(array, [values])
-

Creates a new array concatenating array with any additional arrays -and/or values.

+

创建一个用任何数组 或 值连接的新数组。

参数

    -
  1. array (Array)

    The array to concatenate.

    +
  2. array (Array)

    需要被连接的数组

  3. -
  4. [values] (...*)

    The values to concatenate.

    +
  5. [values] (...*)

    需要被连接的值的队列

返回值 (Array)

-

Returns the new concatenated array.

+

返回连接后的新数组

示例

var array = [1];
@@ -667,23 +666,21 @@ 

示例

-

difference source npm

+

difference source npm

_.difference(array, [values])
-

Creates an array of unique array values not included in the other -provided arrays using SameValueZero -for equality comparisons.

+

创建一个差异化后的数组,不包括使用 SameValueZero 方法提供的数组。

参数

    -
  1. array (Array)

    The array to inspect.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [values] (...Array)

    The values to exclude.

    +
  5. [values] (...Array)

    用于对比差异的数组

返回值 (Array)

-

Returns the new array of filtered values.

+

返回一个差异化后的新数组

示例

_.difference([3, 2, 1], [4, 2]);
@@ -691,55 +688,51 @@ 

示例

-

differenceBy source npm

+

differenceBy source npm

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

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 uniqueness is computed. The iteratee is invoked with one argument: (value).

+

这个方法类似 _.difference,除了它接受一个 iteratee 调用每一个数组和值。iteratee 会传入一个参数:(value)。

参数

    -
  1. array (Array)

    The array to inspect.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [values] (...Array)

    The values to exclude.

    +
  5. [values] (...Array)

    用于对比差异的数组

  6. -
  7. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    +
  8. [iteratee=_.identity] (Function|Object|string)

    这个函数会调用每一个元素

返回值 (Array)

-

Returns the new array of filtered values.

+

返回一个差异化后的新数组

示例

_.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
 // => [3.1, 1.3]
 
-// using the `_.property` callback shorthand
+// 使用了 `_.property` 的回调结果
 _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
 // => [{ 'x': 2 }]
 
-

differenceWith source npm

+

differenceWith source npm

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

This method is like _.difference except that it accepts comparator -which is invoked to compare elements of array to values. The comparator -is invoked with two arguments: (arrVal, othVal).

+

这个方法类似 _.difference,除了它接受一个 comparator 调用每一个数组元素的值。 comparator 会传入2个参数:(arrVal, othVal)。

参数

    -
  1. array (Array)

    The array to inspect.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [values] (...Array)

    The values to exclude.

    +
  5. [values] (...Array)

    用于对比差异的数组

  6. -
  7. [comparator] (Function)

    The comparator invoked per element.

    +
  8. [comparator] (Function)

    这个函数会调用每一个元素

返回值 (Array)

-

Returns the new array of filtered values.

+

返回一个差异化后的新数组

示例

var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
@@ -749,21 +742,21 @@ 

示例

-

drop source npm

+

drop source npm

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

Creates a slice of array with n elements dropped from the beginning.

+

裁剪数组中的前 N 个数组,返回剩余的部分。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [n=1] (number)

    The number of elements to drop.

    +
  5. [n=1] (number)

    裁剪的个数

返回值 (Array)

-

Returns the slice of array.

+

返回数组的剩余的部分。

示例

_.drop([1, 2, 3]);
@@ -780,21 +773,21 @@ 

示例

-

dropRight source npm

+

dropRight source npm

_.dropRight(array, [n=1])
-

Creates a slice of array with n elements dropped from the end.

+

从右边开始裁剪数组中的 N 个数组,返回剩余的部分。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [n=1] (number)

    The number of elements to drop.

    +
  5. [n=1] (number)

    裁剪的个数

返回值 (Array)

-

Returns the slice of array.

+

返回数组的剩余的部分。

示例

_.dropRight([1, 2, 3]);
@@ -811,23 +804,21 @@ 

示例

-

dropRightWhile source npm

+

dropRightWhile source npm

_.dropRightWhile(array, [predicate=_.identity])
-

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).

+

从右边开始裁剪数组,起点从 predicate 返回假值开始。predicate 会传入3个参数:(value, index, array)。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (Array)

-

Returns the slice of array.

+

返回裁剪后的数组

示例

var resolve = _.partial(_.map, _, 'user');
@@ -841,33 +832,31 @@ 

示例

resolve( _.dropRightWhile(users, function(o) { return !o.active; }) ); // => ['barney'] -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 resolve( _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }) ); // => ['barney', 'fred'] -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 resolve( _.dropRightWhile(users, ['active', false]) ); // => ['barney'] -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 resolve( _.dropRightWhile(users, 'active') ); // => ['barney', 'fred', 'pebbles']
-

dropWhile source npm

+

dropWhile source npm

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

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).

+

裁剪数组,起点从 predicate 返回假值开始。predicate 会传入3个参数:(value, index, array)。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    array 需要处理的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (Array)

@@ -885,43 +874,42 @@

示例

resolve( _.dropWhile(users, function(o) { return !o.active; }) ); // => ['pebbles'] -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 resolve( _.dropWhile(users, { 'user': 'barney', 'active': false }) ); // => ['fred', 'pebbles'] -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 resolve( _.dropWhile(users, ['active', false]) ); // => ['pebbles'] -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 resolve( _.dropWhile(users, 'active') ); // => ['barney', 'fred', 'pebbles']
-

fill source npm

+

fill source npm

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

Fills elements of array with value from start up to, but not -including, end. +

指定 填充数组,从 startend 的位置,但不包括 end 本身的位置。

-Note: This method mutates array.

+注意: 这个方法会改变数组

参数

    -
  1. array (Array)

    The array to fill.

    +
  2. array (Array)

    需要填充的数组

  3. -
  4. value (*)

    The value to fill array with.

    +
  5. value (*)

    填充的值

  6. -
  7. [start=0] (number)

    The start position.

    +
  8. [start=0] (number)

    开始位置

  9. -
  10. [end=array.length] (number)

    The end position.

    +
  11. [end=array.length] (number)

    结束位置

返回值 (Array)

-

Returns array.

+

返回数组

示例

var array = [1, 2, 3];
@@ -938,22 +926,21 @@ 

示例

-

findIndex source npm

+

findIndex source npm

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

This method is like _.find except that it returns the index of the first -element predicate returns truthy for instead of the element itself.

+

这个方法类似 _.find。除了它返回最先通过 predicate 判断为真值的元素的 index ,而不是元素本身。

参数

    -
  1. array (Array)

    The array to search.

    +
  2. array (Array)

    需要搜索的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (number)

-

Returns the index of the found element, else -1.

+

返回符合元素的 index,否则返回 -1

示例

var users = [
@@ -965,36 +952,35 @@ 

示例

_.findIndex(users, function(o) { return o.user == 'barney'; }); // => 0 -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 _.findIndex(users, { 'user': 'fred', 'active': false }); // => 1 -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 _.findIndex(users, ['active', false]); // => 0 -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 _.findIndex(users, 'active'); // => 2
-

findLastIndex source npm

+

findLastIndex source npm

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

This method is like _.findIndex except that it iterates over elements -of collection from right to left.

+

这个方式类似 _.findIndex , 不过它是从右到左迭代的。

参数

    -
  1. array (Array)

    The array to search.

    +
  2. array (Array)

    需要搜索的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (number)

-

Returns the index of the found element, else -1.

+

返回符合元素的 index,否则返回 -1

示例

var users = [
@@ -1006,37 +992,36 @@ 

示例

_.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); // => 2 -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 _.findLastIndex(users, { 'user': 'barney', 'active': true }); // => 0 -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 _.findLastIndex(users, ['active', false]); // => 2 -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 _.findLastIndex(users, 'active'); // => 0
-

flatMap source npm

+

flatMap source npm

_.flatMap(array, [iteratee=_.identity])
-

Creates an array of flattened values by running each element in array -through iteratee and concating its result to the other mapped values. -The iteratee is invoked with three arguments: (value, index|key, array).

+

创建一个扁平化的数组,每一个值会传入 iteratee 处理,处理结果会与值合并。 +iteratee 会传入3个参数:(value, index|key, array)。

参数

    -
  1. array (Array)

    The array to iterate over.

    +
  2. array (Array)

    遍历用的数组

  3. -
  4. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [iteratee=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (Array)

-

Returns the new array.

+

返回新数组

示例

function duplicate(n) {
@@ -1048,7 +1033,7 @@ 

示例

-

flatten source npm

+

flatten source npm

_.flatten(array)

Flattens array a single level.

@@ -1068,7 +1053,7 @@

示例

-

flattenDeep source npm

+

flattenDeep source npm

_.flattenDeep(array)

This method is like _.flatten except that it recursively flattens array.

@@ -1088,7 +1073,7 @@

示例

-

fromPairs source npm

+

fromPairs source npm

_.fromPairs(pairs)

The inverse of _.toPairs; this method returns an object composed @@ -1109,7 +1094,7 @@

示例

-

head first source npm

+

head first source npm

_.head(array)

Gets the first element of array.

@@ -1132,7 +1117,7 @@

示例

-

indexOf source npm

+

indexOf source npm

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

Gets the index at which the first occurrence of value is found in array @@ -1164,7 +1149,7 @@

示例

-

initial source npm

+

initial source npm

_.initial(array)

Gets all but the last element of array.

@@ -1184,7 +1169,7 @@

示例

-

intersection source npm

+

intersection source npm

_.intersection([arrays])

Creates an array of unique values that are included in all of the provided @@ -1206,7 +1191,7 @@

示例

-

intersectionBy source npm

+

intersectionBy source npm

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

This method is like _.intersection except that it accepts iteratee @@ -1234,7 +1219,7 @@

示例

-

intersectionWith source npm

+

intersectionWith source npm

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

This method is like _.intersection except that it accepts comparator @@ -1261,7 +1246,7 @@

示例

-

join source npm

+

join source npm

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

Converts all elements in array into a string separated by separator.

@@ -1283,7 +1268,7 @@

示例

-

last source npm

+

last source npm

_.last(array)

Gets the last element of array.

@@ -1303,7 +1288,7 @@

示例

-

lastIndexOf source npm

+

lastIndexOf source npm

_.lastIndexOf(array, value, [fromIndex=array.length-1])

This method is like _.indexOf except that it iterates over elements of @@ -1332,7 +1317,7 @@

示例

-

prototype.reverse source npm

+

prototype.reverse source npm

_.prototype.reverse()

Reverses array so that the first element becomes the last, the second @@ -1357,7 +1342,7 @@

示例

-

pull source npm

+

pull source npm

_.pull(array, [values])

Removes all provided values from array using @@ -1387,7 +1372,7 @@

示例

-

pullAll source npm

+

pullAll source npm

_.pullAll(array, values)

This method is like _.pull except that it accepts an array of values to remove. @@ -1415,7 +1400,7 @@

示例

-

pullAllBy source npm

+

pullAllBy source npm

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

This method is like _.pullAll except that it accepts iteratee which is @@ -1447,7 +1432,7 @@

示例

-

pullAt source npm

+

pullAt source npm

_.pullAt(array, [indexes])

Removes elements from array corresponding to indexes and returns an @@ -1479,7 +1464,7 @@

示例

-

remove source npm

+

remove source npm

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

Removes all elements from array that predicate returns truthy for @@ -1514,7 +1499,7 @@

示例

-

slice source npm

+

slice source npm

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

Creates a slice of array from start up to, but not including, end. @@ -1537,7 +1522,7 @@

返回值 (Array)

Returns the slice of array.

-

sortedIndex source npm

+

sortedIndex source npm

_.sortedIndex(array, value)

Uses a binary search to determine the lowest index at which value should @@ -1563,7 +1548,7 @@

示例

-

sortedIndexBy source npm

+

sortedIndexBy source npm

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

This method is like _.sortedIndex except that it accepts iteratee @@ -1595,7 +1580,7 @@

示例

-

sortedIndexOf source npm

+

sortedIndexOf source npm

_.sortedIndexOf(array, value)

This method is like _.indexOf except that it performs a binary @@ -1618,7 +1603,7 @@

示例

-

sortedLastIndex source npm

+

sortedLastIndex source npm

_.sortedLastIndex(array, value)

This method is like _.sortedIndex except that it returns the highest @@ -1642,7 +1627,7 @@

示例

-

sortedLastIndexBy source npm

+

sortedLastIndexBy source npm

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

This method is like _.sortedLastIndex except that it accepts iteratee @@ -1669,7 +1654,7 @@

示例

-

sortedLastIndexOf source npm

+

sortedLastIndexOf source npm

_.sortedLastIndexOf(array, value)

This method is like _.lastIndexOf except that it performs a binary @@ -1692,7 +1677,7 @@

示例

-

sortedUniq source npm

+

sortedUniq source npm

_.sortedUniq(array)

This method is like _.uniq except that it's designed and optimized @@ -1713,7 +1698,7 @@

示例

-

sortedUniqBy source npm

+

sortedUniqBy source npm

_.sortedUniqBy(array, [iteratee])

This method is like _.uniqBy except that it's designed and optimized @@ -1736,7 +1721,7 @@

示例

-

tail source npm

+

tail source npm

_.tail(array)

Gets all but the first element of array.

@@ -1756,7 +1741,7 @@

示例

-

take source npm

+

take source npm

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

Creates a slice of array with n elements taken from the beginning.

@@ -1787,7 +1772,7 @@

示例

-

takeRight source npm

+

takeRight source npm

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

Creates a slice of array with n elements taken from the end.

@@ -1818,7 +1803,7 @@

示例

-

takeRightWhile source npm

+

takeRightWhile source npm

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

Creates a slice of array with elements taken from the end. Elements are @@ -1862,7 +1847,7 @@

示例

-

takeWhile source npm

+

takeWhile source npm

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

Creates a slice of array with elements taken from the beginning. Elements @@ -1906,7 +1891,7 @@

示例

-

union source npm

+

union source npm

_.union([arrays])

Creates an array of unique values, in order, from all of the provided arrays @@ -1928,7 +1913,7 @@

示例

-

unionBy source npm

+

unionBy source npm

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

This method is like _.union except that it accepts iteratee which is @@ -1956,7 +1941,7 @@

示例

-

unionWith source npm

+

unionWith source npm

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

This method is like _.union except that it accepts comparator which @@ -1983,7 +1968,7 @@

示例

-

uniq source npm

+

uniq source npm

_.uniq(array)

Creates a duplicate-free version of an array, using @@ -2006,7 +1991,7 @@

示例

-

uniqBy source npm

+

uniqBy source npm

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

This method is like _.uniq except that it accepts iteratee which is @@ -2034,7 +2019,7 @@

示例

-

uniqWith source npm

+

uniqWith source npm

_.uniqWith(array, [comparator])

This method is like _.uniq except that it accepts comparator which @@ -2060,7 +2045,7 @@

示例

-

unzip source npm

+

unzip source npm

_.unzip(array)

This method is like _.zip except that it accepts an array of grouped @@ -2085,7 +2070,7 @@

示例

-

unzipWith source npm

+

unzipWith source npm

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

This method is like _.unzip except that it accepts iteratee to specify @@ -2113,7 +2098,7 @@

示例

-

without source npm

+

without source npm

_.without(array, [values])

Creates an array excluding all provided values using @@ -2137,7 +2122,7 @@

示例

-

xor source npm

+

xor source npm

_.xor([arrays])

Creates an array of unique values that is the symmetric difference @@ -2158,7 +2143,7 @@

示例

-

xorBy source npm

+

xorBy source npm

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

This method is like _.xor except that it accepts iteratee which is @@ -2186,7 +2171,7 @@

示例

-

xorWith source npm

+

xorWith source npm

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

This method is like _.xor except that it accepts comparator which is @@ -2213,7 +2198,7 @@

示例

-

zip source npm

+

zip source npm

_.zip([arrays])

Creates an array of grouped elements, the first of which contains the first @@ -2235,7 +2220,7 @@

示例

-

zipObject source npm

+

zipObject source npm

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

This method is like _.fromPairs except that it accepts two arrays, @@ -2258,7 +2243,7 @@

示例

-

zipWith source npm

+

zipWith source npm

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

This method is like _.zip except that it accepts iteratee to specify @@ -2283,7 +2268,7 @@

示例

-

_ source

+

_ source

_(value)

Creates a lodash object which wraps value to enable implicit method @@ -2377,7 +2362,7 @@

示例

-

chain source

+

chain source

_.chain(value)

Creates a lodash object that wraps value with explicit method chaining enabled. @@ -2411,7 +2396,7 @@

示例

-

prototype.at source

+

prototype.at source

_.prototype.at([paths])

This method is the wrapper version of _.at.

@@ -2436,7 +2421,7 @@

示例

-

prototype.chain source

+

prototype.chain source

_.prototype.chain()

Enables explicit method chaining on the wrapper object.

@@ -2465,7 +2450,7 @@

示例

-

prototype.commit source

+

prototype.commit source

_.prototype.commit()

Executes the chained sequence and returns the wrapped result.

@@ -2493,7 +2478,7 @@

示例

-

prototype.next source

+

prototype.next source

_.prototype.next()

Gets the next value on a wrapped object following the @@ -2517,7 +2502,7 @@

示例

-

prototype.plant source

+

prototype.plant source

_.prototype.plant(value)

Creates a clone of the chained sequence planting value as the wrapped value.

@@ -2547,7 +2532,7 @@

示例

-

prototype.Symbol.iterator source

+

prototype.Symbol.iterator source

_.prototype.Symbol.iterator()

Enables the wrapper to be iterable.

@@ -2567,7 +2552,7 @@

示例

-

prototype.value run, toJSON, valueOf source

+

prototype.value run, toJSON, valueOf source

_.prototype.value()

Executes the chained sequence to extract the unwrapped value.

@@ -2582,7 +2567,7 @@

示例

-

tap source

+

tap source

_.tap(value, interceptor)

This method invokes interceptor and returns value. The interceptor is @@ -2612,7 +2597,7 @@

示例

-

thru source

+

thru source

_.thru(value, interceptor)

This method is like _.tap except that it returns the result of interceptor.

@@ -2640,7 +2625,7 @@

示例

-

wrapperFlatMap source

+

wrapperFlatMap source

_.wrapperFlatMap([iteratee=_.identity])

This method is the wrapper version of _.flatMap.

@@ -2664,7 +2649,7 @@

示例

-

countBy source npm

+

countBy source npm

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

Creates an object composed of keys generated from the results of running @@ -2692,7 +2677,7 @@

示例

-

every source npm

+

every source npm

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

Checks if predicate returns truthy for all elements of collection. @@ -2733,7 +2718,7 @@

示例

-

filter source npm

+

filter source npm

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

Iterates over elements of collection, returning an array of all elements @@ -2776,7 +2761,7 @@

示例

-

find source npm

+

find source npm

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

Iterates over elements of collection, returning the first element @@ -2820,7 +2805,7 @@

示例

-

findLast source npm

+

findLast source npm

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

This method is like _.find except that it iterates over elements of @@ -2845,7 +2830,7 @@

示例

-

forEach each source npm

+

forEach each source npm

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

Iterates over elements of collection invoking iteratee for each element. @@ -2881,7 +2866,7 @@

示例

-

forEachRight eachRight source npm

+

forEachRight eachRight source npm

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

This method is like _.forEach except that it iterates over elements of @@ -2906,7 +2891,7 @@

示例

-

groupBy source npm

+

groupBy source npm

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

Creates an object composed of keys generated from the results of running @@ -2935,7 +2920,7 @@

示例

-

includes source npm

+

includes source npm

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

Checks if value is in collection. If collection is a string it's checked @@ -2971,7 +2956,7 @@

示例

-

invokeMap source npm

+

invokeMap source npm

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

Invokes the method at path of each element in collection, returning @@ -3001,7 +2986,7 @@

示例

-

keyBy source npm

+

keyBy source npm

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

Creates an object composed of keys generated from the results of running @@ -3036,7 +3021,7 @@

示例

-

map source npm

+

map source npm

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

Creates an array of values by running each element in collection through @@ -3087,7 +3072,7 @@

示例

-

orderBy source npm

+

orderBy source npm

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

This method is like _.sortBy except that it allows specifying the sort @@ -3124,7 +3109,7 @@

示例

-

partition source npm

+

partition source npm

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

Creates an array of elements split into two groups, the first of which @@ -3171,7 +3156,7 @@

示例

-

reduce source npm

+

reduce source npm

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

Reduces collection to a value which is the accumulated result of running @@ -3217,7 +3202,7 @@

示例

-

reduceRight source npm

+

reduceRight source npm

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

This method is like _.reduce except that it iterates over elements of @@ -3246,7 +3231,7 @@

示例

-

reject source npm

+

reject source npm

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

The opposite of _.filter; this method returns the elements of collection @@ -3288,7 +3273,7 @@

示例

-

sample source npm

+

sample source npm

_.sample(collection)

Gets a random element from collection.

@@ -3308,7 +3293,7 @@

示例

-

sampleSize source npm

+

sampleSize source npm

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

Gets n random elements from collection.

@@ -3330,7 +3315,7 @@

示例

-

shuffle source npm

+

shuffle source npm

_.shuffle(collection)

Creates an array of shuffled values, using a version of the @@ -3351,7 +3336,7 @@

示例

-

size source npm

+

size source npm

_.size(collection)

Gets the size of collection by returning its length for array-like @@ -3378,7 +3363,7 @@

示例

-

some source npm

+

some source npm

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

Checks if predicate returns truthy for any element of collection. @@ -3419,7 +3404,7 @@

示例

-

sortBy source npm

+

sortBy source npm

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

Creates an array of elements, sorted in ascending order by the results of @@ -3461,7 +3446,7 @@

示例

-

now source npm

+

now source npm

_.now()

Gets the timestamp of the number of milliseconds that have elapsed since @@ -3479,7 +3464,7 @@

示例

-

after source npm

+

after source npm

_.after(n, func)

The opposite of _.before; this method creates a function that invokes @@ -3510,7 +3495,7 @@

示例

-

ary source npm

+

ary source npm

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

Creates a function that accepts up to n arguments, ignoring any @@ -3533,7 +3518,7 @@

示例

-

before source npm

+

before source npm

_.before(n, func)

Creates a function that invokes func, with the this binding and arguments @@ -3557,7 +3542,7 @@

示例

-

bind source npm

+

bind source npm

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

Creates a function that invokes func with the this binding of thisArg @@ -3603,7 +3588,7 @@

示例

-

bindKey source npm

+

bindKey source npm

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

Creates a function that invokes the method at object[key] and prepends @@ -3658,7 +3643,7 @@

示例

-

curry source npm

+

curry source npm

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

Creates a function that accepts arguments of func and either invokes @@ -3707,7 +3692,7 @@

示例

-

curryRight source npm

+

curryRight source npm

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

This method is like _.curry except that arguments are applied to func @@ -3753,7 +3738,7 @@

示例

-

debounce source npm

+

debounce source npm

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

Creates a debounced function that delays invoking func until after wait @@ -3813,7 +3798,7 @@

示例

-

defer source npm

+

defer source npm

_.defer(func, [args])

Defers invoking the func until the current call stack has cleared. Any @@ -3838,7 +3823,7 @@

示例

-

delay source npm

+

delay source npm

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

Invokes func after wait milliseconds. Any additional arguments are @@ -3865,7 +3850,7 @@

示例

-

flip source npm

+

flip source npm

_.flip(func)

Creates a function that invokes func with arguments reversed.

@@ -3889,7 +3874,7 @@

示例

-

memoize source npm

+

memoize source npm

_.memoize(func, [resolver])

Creates a function that memoizes the result of func. If resolver is @@ -3940,7 +3925,7 @@

示例

-

negate source npm

+

negate source npm

_.negate(predicate)

Creates a function that negates the result of the predicate func. The @@ -3966,7 +3951,7 @@

示例

-

once source npm

+

once source npm

_.once(func)

Creates a function that is restricted to invoking func once. Repeat calls @@ -3990,7 +3975,7 @@

示例

-

overArgs source npm

+

overArgs source npm

_.overArgs(func, [transforms])

Creates a function that invokes func with arguments transformed by @@ -4028,7 +4013,7 @@

示例

-

partial source npm

+

partial source npm

_.partial(func, [partials])

Creates a function that invokes func with partial arguments prepended @@ -4070,7 +4055,7 @@

示例

-

partialRight source npm

+

partialRight source npm

_.partialRight(func, [partials])

This method is like _.partial except that partially applied arguments @@ -4111,7 +4096,7 @@

示例

-

rearg source npm

+

rearg source npm

_.rearg(func, indexes)

Creates a function that invokes func with arguments arranged according @@ -4140,7 +4125,7 @@

示例

-

rest source npm

+

rest source npm

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

Creates a function that invokes func with the this binding of the @@ -4171,7 +4156,7 @@

示例

-

spread source npm

+

spread source npm

_.spread(func)

Creates a function that invokes func with the this binding of the created @@ -4210,7 +4195,7 @@

示例

-

throttle source npm

+

throttle source npm

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

Creates a throttled function that only invokes func at most once per @@ -4261,7 +4246,7 @@

示例

-

unary source npm

+

unary source npm

_.unary(func)

Creates a function that accepts up to one argument, ignoring any @@ -4282,7 +4267,7 @@

示例

-

wrap source npm

+

wrap source npm

_.wrap(value, wrapper)

Creates a function that provides value to the wrapper function as its @@ -4311,7 +4296,7 @@

示例

-

clone source npm

+

clone source npm

_.clone(value)

Creates a shallow clone of value. @@ -4320,11 +4305,10 @@

示例

Note: This method is loosely based on the 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 and objects created -by constructors other than Object are cloned as plain Object objects. -An empty object is returned for uncloneable values such as error objects, -functions, DOM nodes, and WeakMaps.

+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.

参数

@@ -4347,7 +4331,7 @@

示例

-

cloneDeep source npm

+

cloneDeep source npm

_.cloneDeep(value)

This method is like _.clone except that it recursively clones value.

@@ -4373,7 +4357,7 @@

示例

-

cloneDeepWith source npm

+

cloneDeepWith source npm

_.cloneDeepWith(value, [customizer])

This method is like _.cloneWith except that it recursively clones value.

@@ -4407,7 +4391,7 @@

示例

-

cloneWith source npm

+

cloneWith source npm

_.cloneWith(value, [customizer])

This method is like _.clone except that it accepts customizer which @@ -4444,7 +4428,7 @@

示例

-

eq source npm

+

eq source npm

_.eq(value, other)

Performs a SameValueZero @@ -4482,7 +4466,7 @@

示例

-

gt source npm

+

gt source npm

_.gt(value, other)

Checks if value is greater than other.

@@ -4510,7 +4494,7 @@

示例

-

gte source npm

+

gte source npm

_.gte(value, other)

Checks if value is greater than or equal to other.

@@ -4538,7 +4522,7 @@

示例

-

isArguments source npm

+

isArguments source npm

_.isArguments(value)

Checks if value is likely an arguments object.

@@ -4561,7 +4545,7 @@

示例

-

isArray source npm

+

isArray source npm

_.isArray(value)

Checks if value is classified as an Array object.

@@ -4590,7 +4574,7 @@

示例

-

isArrayLike source npm

+

isArrayLike source npm

_.isArrayLike(value)

Checks if value is array-like. A value is considered array-like if it's @@ -4621,7 +4605,7 @@

示例

-

isArrayLikeObject source npm

+

isArrayLikeObject source npm

_.isArrayLikeObject(value)

This method is like _.isArrayLike except that it also checks if value @@ -4651,7 +4635,7 @@

示例

-

isBoolean source npm

+

isBoolean source npm

_.isBoolean(value)

Checks if value is classified as a boolean primitive or object.

@@ -4674,7 +4658,7 @@

示例

-

isDate source npm

+

isDate source npm

_.isDate(value)

Checks if value is classified as a Date object.

@@ -4697,7 +4681,7 @@

示例

-

isElement source npm

+

isElement source npm

_.isElement(value)

Checks if value is likely a DOM element.

@@ -4720,7 +4704,7 @@

示例

-

isEmpty source npm

+

isEmpty source npm

_.isEmpty(value)

Checks if value is empty. A value is considered empty unless it's an @@ -4754,7 +4738,7 @@

示例

-

isEqual source npm

+

isEqual source npm

_.isEqual(value, other)

Performs a deep comparison between two values to determine if they are @@ -4790,7 +4774,7 @@

示例

-

isEqualWith source npm

+

isEqualWith source npm

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

This method is like _.isEqual except that it accepts customizer which is @@ -4830,7 +4814,7 @@

示例

-

isError source npm

+

isError source npm

_.isError(value)

Checks if value is an Error, EvalError, RangeError, ReferenceError, @@ -4854,7 +4838,7 @@

示例

-

isFinite source npm

+

isFinite source npm

_.isFinite(value)

Checks if value is a finite primitive number. @@ -4886,7 +4870,7 @@

示例

-

isFunction source npm

+

isFunction source npm

_.isFunction(value)

Checks if value is classified as a Function object.

@@ -4909,7 +4893,7 @@

示例

-

isInteger source npm

+

isInteger source npm

_.isInteger(value)

Checks if value is an integer. @@ -4941,7 +4925,7 @@

示例

-

isLength source npm

+

isLength source npm

_.isLength(value)

Checks if value is a valid array-like length. @@ -4973,7 +4957,7 @@

示例

-

isMatch source npm

+

isMatch source npm

_.isMatch(object, source)

Performs a deep comparison between object and source to determine if @@ -5004,7 +4988,7 @@

示例

-

isMatchWith source npm

+

isMatchWith source npm

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

This method is like _.isMatch except that it accepts customizer which @@ -5044,7 +5028,7 @@

示例

-

isNaN source npm

+

isNaN source npm

_.isNaN(value)

Checks if value is NaN. @@ -5077,7 +5061,7 @@

示例

-

isNative source npm

+

isNative source npm

_.isNative(value)

Checks if value is a native function.

@@ -5100,7 +5084,7 @@

示例

-

isNil source npm

+

isNil source npm

_.isNil(value)

Checks if value is null or undefined.

@@ -5126,7 +5110,7 @@

示例

-

isNull source npm

+

isNull source npm

_.isNull(value)

Checks if value is null.

@@ -5149,7 +5133,7 @@

示例

-

isNumber source npm

+

isNumber source npm

_.isNumber(value)

Checks if value is classified as a Number primitive or object. @@ -5182,7 +5166,7 @@

示例

-

isObject source npm

+

isObject source npm

_.isObject(value)

Checks if value is the language type of Object. @@ -5212,7 +5196,7 @@

示例

-

isObjectLike source npm

+

isObjectLike source npm

_.isObjectLike(value)

Checks if value is object-like. A value is object-like if it's not null @@ -5242,7 +5226,7 @@

示例

-

isPlainObject source npm

+

isPlainObject source npm

_.isPlainObject(value)

Checks if value is a plain object, that is, an object created by the @@ -5276,7 +5260,7 @@

示例

-

isRegExp source npm

+

isRegExp source npm

_.isRegExp(value)

Checks if value is classified as a RegExp object.

@@ -5299,7 +5283,7 @@

示例

-

isSafeInteger source npm

+

isSafeInteger source npm

_.isSafeInteger(value)

Checks if value is a safe integer. An integer is safe if it's an IEEE-754 @@ -5332,7 +5316,7 @@

示例

-

isString source npm

+

isString source npm

_.isString(value)

Checks if value is classified as a String primitive or object.

@@ -5355,7 +5339,7 @@

示例

-

isSymbol source npm

+

isSymbol source npm

_.isSymbol(value)

Checks if value is classified as a Symbol primitive or object.

@@ -5378,7 +5362,7 @@

示例

-

isTypedArray source npm

+

isTypedArray source npm

_.isTypedArray(value)

Checks if value is classified as a typed array.

@@ -5401,7 +5385,7 @@

示例

-

isUndefined source npm

+

isUndefined source npm

_.isUndefined(value)

Checks if value is undefined.

@@ -5424,7 +5408,7 @@

示例

-

lt source npm

+

lt source npm

_.lt(value, other)

Checks if value is less than other.

@@ -5452,7 +5436,7 @@

示例

-

lte source npm

+

lte source npm

_.lte(value, other)

Checks if value is less than or equal to other.

@@ -5480,7 +5464,7 @@

示例

-

toArray source npm

+

toArray source npm

_.toArray(value)

Converts value to an array.

@@ -5502,7 +5486,7 @@

示例

-

toInteger source npm

+

toInteger source npm

_.toInteger(value)

Converts value to an integer. @@ -5534,7 +5518,7 @@

示例

-

toLength source npm

+

toLength source npm

_.toLength(value)

Converts value to an integer suitable for use as the length of an @@ -5564,7 +5548,7 @@

示例

-

toNumber source npm

+

toNumber source npm

_.toNumber(value)

Converts value to a number.

@@ -5593,7 +5577,7 @@

示例

-

toPlainObject source npm

+

toPlainObject source npm

_.toPlainObject(value)

Converts value to a plain object flattening inherited enumerable @@ -5623,7 +5607,7 @@

示例

-

toSafeInteger source npm

+

toSafeInteger source npm

_.toSafeInteger(value)

Converts value to a safe integer. A safe integer can be compared and @@ -5653,7 +5637,7 @@

示例

-

toString source npm

+

toString source npm

_.toString(value)

Converts value to a string if it's not one. An empty string is returned @@ -5680,7 +5664,7 @@

示例

-

add source npm

+

add source npm

_.add(augend, addend)

Adds two numbers.

@@ -5702,7 +5686,7 @@

示例

-

ceil source npm

+

ceil source npm

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

Computes number rounded up to precision.

@@ -5730,7 +5714,7 @@

示例

-

floor source npm

+

floor source npm

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

Computes number rounded down to precision.

@@ -5758,7 +5742,7 @@

示例

-

max source npm

+

max source npm

_.max(array)

Computes the maximum value of array. If array is empty or falsey @@ -5782,7 +5766,7 @@

示例

-

maxBy source npm

+

maxBy source npm

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

This method is like _.max except that it accepts iteratee which is @@ -5815,7 +5799,7 @@

示例

-

mean source npm

+

mean source npm

_.mean(array)

Computes the mean of the values in array.

@@ -5835,7 +5819,7 @@

示例

-

min source npm

+

min source npm

_.min(array)

Computes the minimum value of array. If array is empty or falsey @@ -5859,7 +5843,7 @@

示例

-

minBy source npm

+

minBy source npm

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

This method is like _.min except that it accepts iteratee which is @@ -5892,7 +5876,7 @@

示例

-

round source npm

+

round source npm

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

Computes number rounded to precision.

@@ -5920,7 +5904,7 @@

示例

-

subtract source npm

+

subtract source npm

_.subtract(minuend, subtrahend)

Subtract two numbers.

@@ -5942,7 +5926,7 @@

示例

-

sum source npm

+

sum source npm

_.sum(array)

Computes the sum of the values in array.

@@ -5962,7 +5946,7 @@

示例

-

sumBy source npm

+

sumBy source npm

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

This method is like _.sum except that it accepts iteratee which is @@ -5992,7 +5976,7 @@

示例

-

stringSize source

+

stringSize source

stringSize(string)

Gets the number of symbols in string.

@@ -6007,14 +5991,14 @@

返回值 (number)

Returns the string size.

-

templateSettings.imports._ source

+

templateSettings.imports._ source

_.templateSettings.imports._

A reference to the lodash function.

-

clamp source npm

+

clamp source npm

_.clamp(number, [min], max)

Returns a number whose value is limited to the given range specified @@ -6042,7 +6026,7 @@

示例

-

inRange source npm

+

inRange source npm

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

Checks if n is between start and up to but not including, end. If @@ -6087,7 +6071,7 @@

示例

-

random source npm

+

random source npm

_.random([min=0], [max=1], [floating])

Produces a random number between min and max (inclusive). If only one @@ -6127,7 +6111,7 @@

示例

-

assign source npm

+

assign source npm

_.assign(object, [sources])

Assigns own enumerable properties of source objects to the destination @@ -6166,7 +6150,7 @@

示例

-

assignIn extend source npm

+

assignIn extend source npm

_.assignIn(object, [sources])

This method is like _.assign except that it iterates over own and @@ -6203,7 +6187,7 @@

示例

-

assignInWith extendWith source npm

+

assignInWith extendWith source npm

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

This method is like _.assignIn except that it accepts customizer which @@ -6239,7 +6223,7 @@

示例

-

assignWith source npm

+

assignWith source npm

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

This method is like _.assign except that it accepts customizer which @@ -6275,7 +6259,7 @@

示例

-

at source npm

+

at source npm

_.at(object, [paths])

Creates an array of values corresponding to paths of object.

@@ -6302,7 +6286,7 @@

示例

-

create source npm

+

create source npm

_.create(prototype, [properties])

Creates an object that inherits from the prototype object. If a properties @@ -6342,7 +6326,7 @@

示例

-

defaults source npm

+

defaults source npm

_.defaults(object, [sources])

Assigns own and inherited enumerable properties of source objects to the @@ -6370,7 +6354,7 @@

示例

-

defaultsDeep source npm

+

defaultsDeep source npm

_.defaultsDeep(object, [sources])

This method is like _.defaults except that it recursively assigns @@ -6396,7 +6380,7 @@

示例

-

findKey source npm

+

findKey source npm

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

This method is like _.find except that it returns the key of the first @@ -6437,7 +6421,7 @@

示例

-

findLastKey source npm

+

findLastKey source npm

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

This method is like _.findKey except that it iterates over elements of @@ -6478,7 +6462,7 @@

示例

-

forIn source npm

+

forIn source npm

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

Iterates over own and inherited enumerable properties of an object invoking @@ -6512,7 +6496,7 @@

示例

-

forInRight source npm

+

forInRight source npm

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

This method is like _.forIn except that it iterates over properties of @@ -6544,7 +6528,7 @@

示例

-

forOwn source npm

+

forOwn source npm

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

Iterates over own enumerable properties of an object invoking iteratee @@ -6578,7 +6562,7 @@

示例

-

forOwnRight source npm

+

forOwnRight source npm

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

This method is like _.forOwn except that it iterates over properties of @@ -6610,7 +6594,7 @@

示例

-

functions source npm

+

functions source npm

_.functions(object)

Creates an array of function property names from own enumerable properties @@ -6638,7 +6622,7 @@

示例

-

functionsIn source npm

+

functionsIn source npm

_.functionsIn(object)

Creates an array of function property names from own and inherited @@ -6666,7 +6650,7 @@

示例

-

get source npm

+

get source npm

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

Gets the value at path of object. If the resolved value is @@ -6699,7 +6683,7 @@

示例

-

has source npm

+

has source npm

_.has(object, path)

Checks if path is a direct property of object.

@@ -6733,7 +6717,7 @@

示例

-

hasIn source npm

+

hasIn source npm

_.hasIn(object, path)

Checks if path is a direct or inherited property of object.

@@ -6766,7 +6750,7 @@

示例

-

invert source npm

+

invert source npm

_.invert(object, [multiVal])

Creates an object composed of the inverted keys and values of object. @@ -6796,7 +6780,7 @@

示例

-

invoke source npm

+

invoke source npm

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

Invokes the method at path of object.

@@ -6822,7 +6806,7 @@

示例

-

keys source npm

+

keys source npm

_.keys(object)

Creates an array of the own enumerable property names of object. @@ -6857,7 +6841,7 @@

示例

-

keysIn source npm

+

keysIn source npm

_.keysIn(object)

Creates an array of the own and inherited enumerable property names of object. @@ -6887,7 +6871,7 @@

示例

-

mapKeys source npm

+

mapKeys source npm

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

The opposite of _.mapValues; this method creates an object with the @@ -6913,7 +6897,7 @@

示例

-

mapValues source npm

+

mapValues source npm

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

Creates an object with the same keys as object and values generated by @@ -6946,7 +6930,7 @@

示例

-

merge source npm

+

merge source npm

_.merge(object, [sources])

Recursively merges own and inherited enumerable properties of source @@ -6984,7 +6968,7 @@

示例

-

mergeWith source npm

+

mergeWith source npm

_.mergeWith(object, sources, customizer)

This method is like _.merge except that it accepts customizer which @@ -7028,7 +7012,7 @@

示例

-

omit source npm

+

omit source npm

_.omit(object, [props])

The opposite of _.pick; this method creates an object composed of the @@ -7053,7 +7037,7 @@

示例

-

omitBy source npm

+

omitBy source npm

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

The opposite of _.pickBy; this method creates an object composed of the @@ -7079,7 +7063,7 @@

示例

-

pick source npm

+

pick source npm

_.pick(object, [props])

Creates an object composed of the picked object properties.

@@ -7103,7 +7087,7 @@

示例

-

pickBy source npm

+

pickBy source npm

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

Creates an object composed of the object properties predicate returns @@ -7128,7 +7112,7 @@

示例

-

result source npm

+

result source npm

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

This method is like _.get except that if the resolved value is a function @@ -7165,7 +7149,7 @@

示例

-

set source npm

+

set source npm

_.set(object, path, value)

Sets the value at path of object. If a portion of path doesn't exist @@ -7199,7 +7183,7 @@

示例

-

setWith source npm

+

setWith source npm

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

This method is like _.set except that it accepts customizer which is @@ -7228,7 +7212,7 @@

示例

-

toPairs source npm

+

toPairs source npm

_.toPairs(object)

Creates an array of own enumerable key-value pairs for object.

@@ -7255,7 +7239,7 @@

示例

-

toPairsIn source npm

+

toPairsIn source npm

_.toPairsIn(object)

Creates an array of own and inherited enumerable key-value pairs for object.

@@ -7282,7 +7266,7 @@

示例

-

transform source npm

+

transform source npm

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

An alternative to _.reduce; this method transforms object to a new @@ -7319,7 +7303,7 @@

示例

-

unset source npm

+

unset source npm

_.unset(object, path)

Removes the property at path of object.

@@ -7351,7 +7335,7 @@

示例

-

values source npm

+

values source npm

_.values(object)

Creates an array of the own enumerable property values of object. @@ -7384,7 +7368,7 @@

示例

-

valuesIn source npm

+

valuesIn source npm

_.valuesIn(object)

Creates an array of the own and inherited enumerable property values of object. @@ -7414,7 +7398,7 @@

示例

-

templateSettings source npm

+

templateSettings source npm

_.templateSettings

(Object): By default, the template delimiters used by lodash are like those in @@ -7423,49 +7407,49 @@

示例

-

templateSettings.escape source

+

templateSettings.escape source

_.templateSettings.escape

(RegExp): Used to detect data property values to be HTML-escaped.

-

templateSettings.evaluate source

+

templateSettings.evaluate source

_.templateSettings.evaluate

(RegExp): Used to detect code to be evaluated.

-

templateSettings.imports source

+

templateSettings.imports source

_.templateSettings.imports

(Object): Used to import variables into the compiled template.

-

templateSettings.interpolate source

+

templateSettings.interpolate source

_.templateSettings.interpolate

(RegExp): Used to detect data property values to inject.

-

templateSettings.variable source

+

templateSettings.variable source

_.templateSettings.variable

(string): Used to reference the data object in the template text.

-

VERSION source

+

VERSION source

_.VERSION

(string): The semantic version number.

-

camelCase source npm

+

camelCase source npm

_.camelCase([string=''])

Converts string to camel case.

@@ -7491,7 +7475,7 @@

示例

-

capitalize source npm

+

capitalize source npm

_.capitalize([string=''])

Converts the first character of string to upper case and the remaining @@ -7512,7 +7496,7 @@

示例

-

deburr source npm

+

deburr source npm

_.deburr([string=''])

Deburrs string by converting latin-1 supplementary letters#Character_table) @@ -7533,7 +7517,7 @@

示例

-

endsWith source npm

+

endsWith source npm

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

Checks if string ends with the given target string.

@@ -7563,7 +7547,7 @@

示例

-

escape source npm

+

escape source npm

_.escape([string=''])

Converts the characters "&", "<", ">", '"', "'", and "`" in string to @@ -7606,7 +7590,7 @@

示例

-

escapeRegExp source npm

+

escapeRegExp source npm

_.escapeRegExp([string=''])

Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", @@ -7627,7 +7611,7 @@

示例

-

kebabCase source npm

+

kebabCase source npm

_.kebabCase([string=''])

Converts string to kebab case.

@@ -7653,7 +7637,7 @@

示例

-

lowerCase source npm

+

lowerCase source npm

_.lowerCase([string=''])

Converts string, as space separated words, to lower case.

@@ -7679,7 +7663,7 @@

示例

-

lowerFirst source npm

+

lowerFirst source npm

_.lowerFirst([string=''])

Converts the first character of string to lower case.

@@ -7702,7 +7686,7 @@

示例

-

pad source npm

+

pad source npm

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

Pads string on the left and right sides if it's shorter than length. @@ -7733,7 +7717,7 @@

示例

-

padEnd source npm

+

padEnd source npm

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

Pads string on the right side if it's shorter than length. Padding @@ -7764,7 +7748,7 @@

示例

-

padStart source npm

+

padStart source npm

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

Pads string on the left side if it's shorter than length. Padding @@ -7795,7 +7779,7 @@

示例

-

parseInt source npm

+

parseInt source npm

_.parseInt(string, [radix])

Converts string to an integer of the specified radix. If radix is @@ -7826,7 +7810,7 @@

示例

-

repeat source npm

+

repeat source npm

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

Repeats the given string n times.

@@ -7854,7 +7838,7 @@

示例

-

replace source npm

+

replace source npm

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

Replaces matches for pattern in string with replacement. @@ -7881,7 +7865,7 @@

示例

-

snakeCase source npm

+

snakeCase source npm

_.snakeCase([string=''])

Converts string to snake case.

@@ -7907,7 +7891,7 @@

示例

-

split source npm

+

split source npm

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

Splits string by separator. @@ -7934,7 +7918,7 @@

示例

-

startCase source npm

+

startCase source npm

_.startCase([string=''])

Converts string to start case.

@@ -7960,7 +7944,7 @@

示例

-

startsWith source npm

+

startsWith source npm

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

Checks if string starts with the given target string.

@@ -7990,7 +7974,7 @@

示例

-

template source npm

+

template source npm

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

Creates a compiled template function that can interpolate data properties @@ -8102,7 +8086,7 @@

示例

-

toLower source npm

+

toLower source npm

_.toLower([string=''])

Converts string, as a whole, to lower case.

@@ -8128,7 +8112,7 @@

示例

-

toUpper source npm

+

toUpper source npm

_.toUpper([string=''])

Converts string, as a whole, to upper case.

@@ -8154,7 +8138,7 @@

示例

-

trim source npm

+

trim source npm

_.trim([string=''], [chars=whitespace])

Removes leading and trailing whitespace or specified characters from string.

@@ -8182,7 +8166,7 @@

示例

-

trimEnd source npm

+

trimEnd source npm

_.trimEnd([string=''], [chars=whitespace])

Removes trailing whitespace or specified characters from string.

@@ -8207,7 +8191,7 @@

示例

-

trimStart source npm

+

trimStart source npm

_.trimStart([string=''], [chars=whitespace])

Removes leading whitespace or specified characters from string.

@@ -8232,7 +8216,7 @@

示例

-

truncate source npm

+

truncate source npm

_.truncate([string=''], [options])

Truncates string if it's longer than the given maximum string length. @@ -8279,7 +8263,7 @@

示例

-

unescape source npm

+

unescape source npm

_.unescape([string=''])

The inverse of _.escape; this method converts the HTML entities @@ -8305,7 +8289,7 @@

示例

-

upperCase source npm

+

upperCase source npm

_.upperCase([string=''])

Converts string, as space separated words, to upper case.

@@ -8331,7 +8315,7 @@

示例

-

upperFirst source npm

+

upperFirst source npm

_.upperFirst([string=''])

Converts the first character of string to upper case.

@@ -8354,7 +8338,7 @@

示例

-

words source npm

+

words source npm

_.words([string=''], [pattern])

Splits string into an array of its words.

@@ -8379,7 +8363,7 @@

示例

-

attempt source npm

+

attempt source npm

_.attempt(func)

Attempts to invoke func, returning either the result or the caught error @@ -8406,7 +8390,7 @@

示例

-

bindAll source npm

+

bindAll source npm

_.bindAll(object, methodNames)

Binds methods of an object to the object itself, overwriting the existing @@ -8440,7 +8424,7 @@

示例

-

cond source npm

+

cond source npm

_.cond(pairs)

Creates a function that iterates over pairs invoking the corresponding @@ -8475,7 +8459,7 @@

示例

-

conforms source npm

+

conforms source npm

_.conforms(source)

Creates a function that invokes the predicate properties of source with @@ -8502,7 +8486,7 @@

示例

-

constant source npm

+

constant source npm

_.constant(value)

Creates a function that returns value.

@@ -8525,7 +8509,7 @@

示例

-

flow source npm

+

flow source npm

_.flow([funcs])

Creates a function that returns the result of invoking the provided @@ -8552,7 +8536,7 @@

示例

-

flowRight source npm

+

flowRight source npm

_.flowRight([funcs])

This method is like _.flow except that it creates a function that @@ -8578,7 +8562,7 @@

示例

-

identity source npm

+

identity source npm

_.identity(value)

This method returns the first argument provided to it.

@@ -8600,7 +8584,7 @@

示例

-

iteratee source npm

+

iteratee source npm

_.iteratee([func=_.identity])

Creates a function that invokes func with the arguments of the created @@ -8641,7 +8625,7 @@

示例

-

matches source npm

+

matches source npm

_.matches(source)

Creates a function that performs a deep partial comparison between a given @@ -8671,7 +8655,7 @@

示例

-

matchesProperty source npm

+

matchesProperty source npm

_.matchesProperty(path, srcValue)

Creates a function that performs a deep partial comparison between the @@ -8703,7 +8687,7 @@

示例

-

method source npm

+

method source npm

_.method(path, [args])

Creates a function that invokes the method at path of a given object. @@ -8734,7 +8718,7 @@

示例

-

methodOf source npm

+

methodOf source npm

_.methodOf(object, [args])

The opposite of _.method; this method creates a function that invokes @@ -8764,7 +8748,7 @@

示例

-

mixin source npm

+

mixin source npm

_.mixin([object=lodash], source, [options])

Adds all own enumerable function properties of a source object to the @@ -8810,7 +8794,7 @@

示例

-

noConflict source npm

+

noConflict source npm

_.noConflict()

Reverts the _ variable to its previous value and returns a reference to @@ -8825,7 +8809,7 @@

示例

-

noop source npm

+

noop source npm

_.noop()

A no-operation function that returns undefined regardless of the @@ -8840,7 +8824,7 @@

示例

-

nthArg source npm

+

nthArg source npm

_.nthArg([n=0])

Creates a function that returns its nth argument.

@@ -8862,7 +8846,7 @@

示例

-

over source npm

+

over source npm

_.over(iteratees)

Creates a function that invokes iteratees with the arguments provided @@ -8885,7 +8869,7 @@

示例

-

overEvery source npm

+

overEvery source npm

_.overEvery(predicates)

Creates a function that checks if all of the predicates return @@ -8914,7 +8898,7 @@

示例

-

overSome source npm

+

overSome source npm

_.overSome(predicates)

Creates a function that checks if any of the predicates return @@ -8943,7 +8927,7 @@

示例

-

property source npm

+

property source npm

_.property(path)

Creates a function that returns the value at path of a given object.

@@ -8971,7 +8955,7 @@

示例

-

propertyOf source npm

+

propertyOf source npm

_.propertyOf(object)

The opposite of _.property; this method creates a function that returns @@ -8998,7 +8982,7 @@

示例

-

range source npm

+

range source npm

_.range([start=0], end, [step=1])

Creates an array of numbers (positive and/or negative) progressing from @@ -9048,7 +9032,7 @@

示例

-

rangeRight source npm

+

rangeRight source npm

_.rangeRight([start=0], end, [step=1])

This method is like _.range except that it populates values in @@ -9091,7 +9075,7 @@

示例

-

runInContext source npm

+

runInContext source npm

_.runInContext([context=root])

Create a new pristine lodash function using the context object.

@@ -9133,7 +9117,7 @@

示例

-

times source npm

+

times source npm

_.times(n, [iteratee=_.identity])

Invokes the iteratee function n times, returning an array of the results @@ -9159,7 +9143,7 @@

示例

-

toPath source npm

+

toPath source npm

_.toPath(value)

Converts value to a property path array.

@@ -9191,7 +9175,7 @@

示例

-

uniqueId source npm

+

uniqueId source npm

_.uniqueId([prefix])

Generates a unique ID. If prefix is provided the ID is appended to it.

diff --git a/ary.html b/ary.html index acc9acf..117bb26 100644 --- a/ary.html +++ b/ary.html @@ -392,7 +392,7 @@
-

ary source npm

+

ary source npm

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

Creates a function that accepts up to n arguments, ignoring any diff --git a/assign.html b/assign.html index 191e888..69e3026 100644 --- a/assign.html +++ b/assign.html @@ -392,7 +392,7 @@

-

assign source npm

+

assign source npm

_.assign(object, [sources])

Assigns own enumerable properties of source objects to the destination diff --git a/assignIn.html b/assignIn.html index 34a1769..d6df643 100644 --- a/assignIn.html +++ b/assignIn.html @@ -392,7 +392,7 @@

-

assignIn extend source npm

+

assignIn extend source npm

_.assignIn(object, [sources])

This method is like _.assign except that it iterates over own and diff --git a/assignInWith.html b/assignInWith.html index 9634cc2..a3731da 100644 --- a/assignInWith.html +++ b/assignInWith.html @@ -392,7 +392,7 @@

-

assignInWith extendWith source npm

+

assignInWith extendWith source npm

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

This method is like _.assignIn except that it accepts customizer which diff --git a/assignWith.html b/assignWith.html index 6bf7637..0cbcb85 100644 --- a/assignWith.html +++ b/assignWith.html @@ -392,7 +392,7 @@

-

assignWith source npm

+

assignWith source npm

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

This method is like _.assign except that it accepts customizer which diff --git a/at.html b/at.html index eb569aa..19598ee 100644 --- a/at.html +++ b/at.html @@ -392,7 +392,7 @@

-

at source npm

+

at source npm

_.at(object, [paths])

Creates an array of values corresponding to paths of object.

diff --git a/attempt.html b/attempt.html index 07504d9..155a85e 100644 --- a/attempt.html +++ b/attempt.html @@ -392,7 +392,7 @@
-

attempt source npm

+

attempt source npm

_.attempt(func)

Attempts to invoke func, returning either the result or the caught error diff --git a/before.html b/before.html index e08ab1e..dd91dc2 100644 --- a/before.html +++ b/before.html @@ -392,7 +392,7 @@

-

before source npm

+

before source npm

_.before(n, func)

Creates a function that invokes func, with the this binding and arguments diff --git a/bind.html b/bind.html index 1dd7055..20af929 100644 --- a/bind.html +++ b/bind.html @@ -392,7 +392,7 @@

-

bind source npm

+

bind source npm

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

Creates a function that invokes func with the this binding of thisArg diff --git a/bindAll.html b/bindAll.html index 51cfdbc..fed1163 100644 --- a/bindAll.html +++ b/bindAll.html @@ -392,7 +392,7 @@

-

bindAll source npm

+

bindAll source npm

_.bindAll(object, methodNames)

Binds methods of an object to the object itself, overwriting the existing diff --git a/bindKey.html b/bindKey.html index b9fef2e..14485b9 100644 --- a/bindKey.html +++ b/bindKey.html @@ -392,7 +392,7 @@

-

bindKey source npm

+

bindKey source npm

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

Creates a function that invokes the method at object[key] and prepends diff --git a/camelCase.html b/camelCase.html index 9fd90ab..0dda91d 100644 --- a/camelCase.html +++ b/camelCase.html @@ -392,7 +392,7 @@

-

camelCase source npm

+

camelCase source npm

_.camelCase([string=''])

Converts string to camel case.

diff --git a/capitalize.html b/capitalize.html index 47b58d1..f12ea09 100644 --- a/capitalize.html +++ b/capitalize.html @@ -392,7 +392,7 @@
-

capitalize source npm

+

capitalize source npm

_.capitalize([string=''])

Converts the first character of string to upper case and the remaining diff --git a/ceil.html b/ceil.html index 9da8050..d3bb67b 100644 --- a/ceil.html +++ b/ceil.html @@ -392,7 +392,7 @@

-

ceil source npm

+

ceil source npm

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

Computes number rounded up to precision.

diff --git a/chain.html b/chain.html index 32801fa..29aa80f 100644 --- a/chain.html +++ b/chain.html @@ -392,7 +392,7 @@
-

chain source

+

chain source

_.chain(value)

Creates a lodash object that wraps value with explicit method chaining enabled. diff --git a/chunk.html b/chunk.html index bf38b41..44ccc39 100644 --- a/chunk.html +++ b/chunk.html @@ -392,11 +392,11 @@

-

chunk source npm

+

chunk source npm

_.chunk(array, [size=0])
-

将 array 拆分成多个 size 长度的块,并组成一个新数组。 -如果 array 无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。

+

将数组拆分成多个 size 长度的块,并组成一个新数组。 +如果数组无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。

参数

diff --git a/clamp.html b/clamp.html index d0bd04e..a3fc6fa 100644 --- a/clamp.html +++ b/clamp.html @@ -392,7 +392,7 @@
-

clamp source npm

+

clamp source npm

_.clamp(number, [min], max)

Returns a number whose value is limited to the given range specified diff --git a/clone.html b/clone.html index 231754b..7d1b572 100644 --- a/clone.html +++ b/clone.html @@ -392,7 +392,7 @@

-

clone source npm

+

clone source npm

_.clone(value)

Creates a shallow clone of value. @@ -401,11 +401,10 @@ Note: This method is loosely based on the 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 and objects created -by constructors other than Object are cloned as plain Object objects. -An empty object is returned for uncloneable values such as error objects, -functions, DOM nodes, and WeakMaps.

+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.

参数

diff --git a/cloneDeep.html b/cloneDeep.html index 1b1e5ce..fa2816d 100644 --- a/cloneDeep.html +++ b/cloneDeep.html @@ -392,7 +392,7 @@
-

cloneDeep source npm

+

cloneDeep source npm

_.cloneDeep(value)

This method is like _.clone except that it recursively clones value.

diff --git a/cloneDeepWith.html b/cloneDeepWith.html index b5adb5b..c3a254c 100644 --- a/cloneDeepWith.html +++ b/cloneDeepWith.html @@ -392,7 +392,7 @@
-

cloneDeepWith source npm

+

cloneDeepWith source npm

_.cloneDeepWith(value, [customizer])

This method is like _.cloneWith except that it recursively clones value.

diff --git a/cloneWith.html b/cloneWith.html index 8236d76..2260ad6 100644 --- a/cloneWith.html +++ b/cloneWith.html @@ -392,7 +392,7 @@
-

cloneWith source npm

+

cloneWith source npm

_.cloneWith(value, [customizer])

This method is like _.clone except that it accepts customizer which diff --git a/compact.html b/compact.html index cd0252b..0da0610 100644 --- a/compact.html +++ b/compact.html @@ -392,20 +392,20 @@

-

compact source npm

+

compact source npm

_.compact(array)
-

Creates an array with all falsey values removed. The values false, null, -0, "", undefined, and NaN are falsey.

+

创建一个移除了所有假值的数组。例如:falsenull、 +0""undefined, 以及NaN 都是 “假值”.

参数

    -
  1. array (Array)

    The array to compact.

    +
  2. array (Array)

    需要被处理的数组。

返回值 (Array)

-

Returns the new array of filtered values.

+

返回移除了假值的数组。

示例

_.compact([0, 1, false, 2, '', 3]);
diff --git a/concat.html b/concat.html
index 576433b..56125aa 100644
--- a/concat.html
+++ b/concat.html
@@ -392,22 +392,21 @@
 
 
-

concat source npm

+

concat source npm

_.concat(array, [values])
-

Creates a new array concatenating array with any additional arrays -and/or values.

+

创建一个用任何数组 或 值连接的新数组。

参数

    -
  1. array (Array)

    The array to concatenate.

    +
  2. array (Array)

    需要被连接的数组

  3. -
  4. [values] (...*)

    The values to concatenate.

    +
  5. [values] (...*)

    需要被连接的值的队列

返回值 (Array)

-

Returns the new concatenated array.

+

返回连接后的新数组

示例

var array = [1];
diff --git a/cond.html b/cond.html
index 5f7642b..aae35ba 100644
--- a/cond.html
+++ b/cond.html
@@ -392,7 +392,7 @@
 
 
-

cond source npm

+

cond source npm

_.cond(pairs)

Creates a function that iterates over pairs invoking the corresponding diff --git a/conforms.html b/conforms.html index 8145b97..b0e01cc 100644 --- a/conforms.html +++ b/conforms.html @@ -392,7 +392,7 @@

-

conforms source npm

+

conforms source npm

_.conforms(source)

Creates a function that invokes the predicate properties of source with diff --git a/constant.html b/constant.html index 1659337..2aac0cb 100644 --- a/constant.html +++ b/constant.html @@ -392,7 +392,7 @@

-

constant source npm

+

constant source npm

_.constant(value)

Creates a function that returns value.

diff --git a/countBy.html b/countBy.html index 9bd94c4..b26bd55 100644 --- a/countBy.html +++ b/countBy.html @@ -392,7 +392,7 @@
-

countBy source npm

+

countBy source npm

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

Creates an object composed of keys generated from the results of running diff --git a/create.html b/create.html index 4f1a523..eaf79fb 100644 --- a/create.html +++ b/create.html @@ -392,7 +392,7 @@

-

create source npm

+

create source npm

_.create(prototype, [properties])

Creates an object that inherits from the prototype object. If a properties diff --git a/curry.html b/curry.html index 79b1988..e1b1bfa 100644 --- a/curry.html +++ b/curry.html @@ -392,7 +392,7 @@

-

curry source npm

+

curry source npm

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

Creates a function that accepts arguments of func and either invokes diff --git a/curryRight.html b/curryRight.html index 857056c..71f3c7d 100644 --- a/curryRight.html +++ b/curryRight.html @@ -392,7 +392,7 @@

-

curryRight source npm

+

curryRight source npm

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

This method is like _.curry except that arguments are applied to func diff --git a/debounce.html b/debounce.html index a016297..f0e3374 100644 --- a/debounce.html +++ b/debounce.html @@ -392,7 +392,7 @@

-

debounce source npm

+

debounce source npm

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

Creates a debounced function that delays invoking func until after wait diff --git a/deburr.html b/deburr.html index 1b0b8be..303b61d 100644 --- a/deburr.html +++ b/deburr.html @@ -392,7 +392,7 @@

-

deburr source npm

+

deburr source npm

_.deburr([string=''])

Deburrs string by converting latin-1 supplementary letters#Character_table) diff --git a/defaults.html b/defaults.html index d7208a4..9ada41b 100644 --- a/defaults.html +++ b/defaults.html @@ -392,7 +392,7 @@

-

defaults source npm

+

defaults source npm

_.defaults(object, [sources])

Assigns own and inherited enumerable properties of source objects to the diff --git a/defaultsDeep.html b/defaultsDeep.html index 7c68029..81d69ae 100644 --- a/defaultsDeep.html +++ b/defaultsDeep.html @@ -392,7 +392,7 @@

-

defaultsDeep source npm

+

defaultsDeep source npm

_.defaultsDeep(object, [sources])

This method is like _.defaults except that it recursively assigns diff --git a/defer.html b/defer.html index add41bb..0ea36fd 100644 --- a/defer.html +++ b/defer.html @@ -392,7 +392,7 @@

-

defer source npm

+

defer source npm

_.defer(func, [args])

Defers invoking the func until the current call stack has cleared. Any diff --git a/delay.html b/delay.html index c67b206..4b5045c 100644 --- a/delay.html +++ b/delay.html @@ -392,7 +392,7 @@

-

delay source npm

+

delay source npm

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

Invokes func after wait milliseconds. Any additional arguments are diff --git a/difference.html b/difference.html index 759b0d4..d16bb96 100644 --- a/difference.html +++ b/difference.html @@ -392,23 +392,21 @@

-

difference source npm

+

difference source npm

_.difference(array, [values])
-

Creates an array of unique array values not included in the other -provided arrays using SameValueZero -for equality comparisons.

+

创建一个差异化后的数组,不包括使用 SameValueZero 方法提供的数组。

参数

    -
  1. array (Array)

    The array to inspect.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [values] (...Array)

    The values to exclude.

    +
  5. [values] (...Array)

    用于对比差异的数组

返回值 (Array)

-

Returns the new array of filtered values.

+

返回一个差异化后的新数组

示例

_.difference([3, 2, 1], [4, 2]);
diff --git a/differenceBy.html b/differenceBy.html
index 468bde0..e9e314d 100644
--- a/differenceBy.html
+++ b/differenceBy.html
@@ -392,31 +392,29 @@
 
 
-

differenceBy source npm

+

differenceBy source npm

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

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 uniqueness is computed. The iteratee is invoked with one argument: (value).

+

这个方法类似 _.difference,除了它接受一个 iteratee 调用每一个数组和值。iteratee 会传入一个参数:(value)。

参数

    -
  1. array (Array)

    The array to inspect.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [values] (...Array)

    The values to exclude.

    +
  5. [values] (...Array)

    用于对比差异的数组

  6. -
  7. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    +
  8. [iteratee=_.identity] (Function|Object|string)

    这个函数会调用每一个元素

返回值 (Array)

-

Returns the new array of filtered values.

+

返回一个差异化后的新数组

示例

_.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
 // => [3.1, 1.3]
 
-// using the `_.property` callback shorthand
+// 使用了 `_.property` 的回调结果
 _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
 // => [{ 'x': 2 }]
 
diff --git a/differenceWith.html b/differenceWith.html index c8695b3..f8cdf4c 100644 --- a/differenceWith.html +++ b/differenceWith.html @@ -392,25 +392,23 @@
-

differenceWith source npm

+

differenceWith source npm

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

This method is like _.difference except that it accepts comparator -which is invoked to compare elements of array to values. The comparator -is invoked with two arguments: (arrVal, othVal).

+

这个方法类似 _.difference,除了它接受一个 comparator 调用每一个数组元素的值。 comparator 会传入2个参数:(arrVal, othVal)。

参数

    -
  1. array (Array)

    The array to inspect.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [values] (...Array)

    The values to exclude.

    +
  5. [values] (...Array)

    用于对比差异的数组

  6. -
  7. [comparator] (Function)

    The comparator invoked per element.

    +
  8. [comparator] (Function)

    这个函数会调用每一个元素

返回值 (Array)

-

Returns the new array of filtered values.

+

返回一个差异化后的新数组

示例

var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
diff --git a/drop.html b/drop.html
index 407aa18..100d3bc 100644
--- a/drop.html
+++ b/drop.html
@@ -392,21 +392,21 @@
 
 
-

drop source npm

+

drop source npm

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

Creates a slice of array with n elements dropped from the beginning.

+

裁剪数组中的前 N 个数组,返回剩余的部分。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [n=1] (number)

    The number of elements to drop.

    +
  5. [n=1] (number)

    裁剪的个数

返回值 (Array)

-

Returns the slice of array.

+

返回数组的剩余的部分。

示例

_.drop([1, 2, 3]);
diff --git a/dropRight.html b/dropRight.html
index 6e08aea..c0d385d 100644
--- a/dropRight.html
+++ b/dropRight.html
@@ -392,21 +392,21 @@
 
 
-

dropRight source npm

+

dropRight source npm

_.dropRight(array, [n=1])
-

Creates a slice of array with n elements dropped from the end.

+

从右边开始裁剪数组中的 N 个数组,返回剩余的部分。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [n=1] (number)

    The number of elements to drop.

    +
  5. [n=1] (number)

    裁剪的个数

返回值 (Array)

-

Returns the slice of array.

+

返回数组的剩余的部分。

示例

_.dropRight([1, 2, 3]);
diff --git a/dropRightWhile.html b/dropRightWhile.html
index 6a9eb9e..b053ee4 100644
--- a/dropRightWhile.html
+++ b/dropRightWhile.html
@@ -392,23 +392,21 @@
 
 
-

dropRightWhile source npm

+

dropRightWhile source npm

_.dropRightWhile(array, [predicate=_.identity])
-

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).

+

从右边开始裁剪数组,起点从 predicate 返回假值开始。predicate 会传入3个参数:(value, index, array)。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    需要处理的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (Array)

-

Returns the slice of array.

+

返回裁剪后的数组

示例

var resolve = _.partial(_.map, _, 'user');
@@ -422,15 +420,15 @@ 

示例

resolve( _.dropRightWhile(users, function(o) { return !o.active; }) ); // => ['barney'] -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 resolve( _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }) ); // => ['barney', 'fred'] -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 resolve( _.dropRightWhile(users, ['active', false]) ); // => ['barney'] -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 resolve( _.dropRightWhile(users, 'active') ); // => ['barney', 'fred', 'pebbles']
diff --git a/dropWhile.html b/dropWhile.html index 1f20e75..35166db 100644 --- a/dropWhile.html +++ b/dropWhile.html @@ -392,19 +392,17 @@
-

dropWhile source npm

+

dropWhile source npm

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

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).

+

裁剪数组,起点从 predicate 返回假值开始。predicate 会传入3个参数:(value, index, array)。

参数

    -
  1. array (Array)

    The array to query.

    +
  2. array (Array)

    array 需要处理的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (Array)

@@ -422,15 +420,15 @@

示例

resolve( _.dropWhile(users, function(o) { return !o.active; }) ); // => ['pebbles'] -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 resolve( _.dropWhile(users, { 'user': 'barney', 'active': false }) ); // => ['fred', 'pebbles'] -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 resolve( _.dropWhile(users, ['active', false]) ); // => ['pebbles'] -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 resolve( _.dropWhile(users, 'active') ); // => ['barney', 'fred', 'pebbles']
diff --git a/endsWith.html b/endsWith.html index c0113b5..4cf04c2 100644 --- a/endsWith.html +++ b/endsWith.html @@ -392,7 +392,7 @@
-

endsWith source npm

+

endsWith source npm

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

Checks if string ends with the given target string.

diff --git a/eq.html b/eq.html index cd11649..70fc52e 100644 --- a/eq.html +++ b/eq.html @@ -392,7 +392,7 @@
-

eq source npm

+

eq source npm

_.eq(value, other)

Performs a SameValueZero diff --git a/escape.html b/escape.html index 4441c88..19dc2e7 100644 --- a/escape.html +++ b/escape.html @@ -392,7 +392,7 @@

-

escape source npm

+

escape source npm

_.escape([string=''])

Converts the characters "&", "<", ">", '"', "'", and "`" in string to diff --git a/escapeRegExp.html b/escapeRegExp.html index 896e36f..96395ad 100644 --- a/escapeRegExp.html +++ b/escapeRegExp.html @@ -392,7 +392,7 @@

-

escapeRegExp source npm

+

escapeRegExp source npm

_.escapeRegExp([string=''])

Escapes the RegExp special characters "^", "$", "\", ".", "*", "+", diff --git a/every.html b/every.html index 8ea9074..590e5a6 100644 --- a/every.html +++ b/every.html @@ -392,7 +392,7 @@

-

every source npm

+

every source npm

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

Checks if predicate returns truthy for all elements of collection. diff --git a/fill.html b/fill.html index 402e48b..ff35dad 100644 --- a/fill.html +++ b/fill.html @@ -392,29 +392,28 @@

-

fill source npm

+

fill source npm

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

Fills elements of array with value from start up to, but not -including, end. +

指定 填充数组,从 startend 的位置,但不包括 end 本身的位置。

-Note: This method mutates array.

+注意: 这个方法会改变数组

参数

    -
  1. array (Array)

    The array to fill.

    +
  2. array (Array)

    需要填充的数组

  3. -
  4. value (*)

    The value to fill array with.

    +
  5. value (*)

    填充的值

  6. -
  7. [start=0] (number)

    The start position.

    +
  8. [start=0] (number)

    开始位置

  9. -
  10. [end=array.length] (number)

    The end position.

    +
  11. [end=array.length] (number)

    结束位置

返回值 (Array)

-

Returns array.

+

返回数组

示例

var array = [1, 2, 3];
diff --git a/filter.html b/filter.html
index 0a73266..5de7894 100644
--- a/filter.html
+++ b/filter.html
@@ -392,7 +392,7 @@
 
 
-

filter source npm

+

filter source npm

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

Iterates over elements of collection, returning an array of all elements diff --git a/find.html b/find.html index fb8342d..6774b43 100644 --- a/find.html +++ b/find.html @@ -392,7 +392,7 @@

-

find source npm

+

find source npm

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

Iterates over elements of collection, returning the first element diff --git a/findIndex.html b/findIndex.html index be92ccc..4615793 100644 --- a/findIndex.html +++ b/findIndex.html @@ -392,22 +392,21 @@

-

findIndex source npm

+

findIndex source npm

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

This method is like _.find except that it returns the index of the first -element predicate returns truthy for instead of the element itself.

+

这个方法类似 _.find。除了它返回最先通过 predicate 判断为真值的元素的 index ,而不是元素本身。

参数

    -
  1. array (Array)

    The array to search.

    +
  2. array (Array)

    需要搜索的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (number)

-

Returns the index of the found element, else -1.

+

返回符合元素的 index,否则返回 -1

示例

var users = [
@@ -419,15 +418,15 @@ 

示例

_.findIndex(users, function(o) { return o.user == 'barney'; }); // => 0 -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 _.findIndex(users, { 'user': 'fred', 'active': false }); // => 1 -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 _.findIndex(users, ['active', false]); // => 0 -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 _.findIndex(users, 'active'); // => 2
diff --git a/findKey.html b/findKey.html index 940f7ac..8972522 100644 --- a/findKey.html +++ b/findKey.html @@ -392,7 +392,7 @@
-

findKey source npm

+

findKey source npm

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

This method is like _.find except that it returns the key of the first diff --git a/findLast.html b/findLast.html index 710031b..a73bf06 100644 --- a/findLast.html +++ b/findLast.html @@ -392,7 +392,7 @@

-

findLast source npm

+

findLast source npm

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

This method is like _.find except that it iterates over elements of diff --git a/findLastIndex.html b/findLastIndex.html index 3b7470a..132876f 100644 --- a/findLastIndex.html +++ b/findLastIndex.html @@ -392,22 +392,21 @@

-

findLastIndex source npm

+

findLastIndex source npm

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

This method is like _.findIndex except that it iterates over elements -of collection from right to left.

+

这个方式类似 _.findIndex , 不过它是从右到左迭代的。

参数

    -
  1. array (Array)

    The array to search.

    +
  2. array (Array)

    需要搜索的数组

  3. -
  4. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (number)

-

Returns the index of the found element, else -1.

+

返回符合元素的 index,否则返回 -1

示例

var users = [
@@ -419,15 +418,15 @@ 

示例

_.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); // => 2 -// using the `_.matches` callback shorthand +// 使用了 `_.matches` 的回调结果 _.findLastIndex(users, { 'user': 'barney', 'active': true }); // => 0 -// using the `_.matchesProperty` callback shorthand +// 使用了 `_.matchesProperty` 的回调结果 _.findLastIndex(users, ['active', false]); // => 2 -// using the `_.property` callback shorthand +// 使用了 `_.property` 的回调结果 _.findLastIndex(users, 'active'); // => 0
diff --git a/findLastKey.html b/findLastKey.html index d2fc54a..d40dc8a 100644 --- a/findLastKey.html +++ b/findLastKey.html @@ -392,7 +392,7 @@
-

findLastKey source npm

+

findLastKey source npm

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

This method is like _.findKey except that it iterates over elements of diff --git a/flatMap.html b/flatMap.html index 97bc5f8..b6ec75f 100644 --- a/flatMap.html +++ b/flatMap.html @@ -392,23 +392,22 @@

-

flatMap source npm

+

flatMap source npm

_.flatMap(array, [iteratee=_.identity])
-

Creates an array of flattened values by running each element in array -through iteratee and concating its result to the other mapped values. -The iteratee is invoked with three arguments: (value, index|key, array).

+

创建一个扁平化的数组,每一个值会传入 iteratee 处理,处理结果会与值合并。 +iteratee 会传入3个参数:(value, index|key, array)。

参数

    -
  1. array (Array)

    The array to iterate over.

    +
  2. array (Array)

    遍历用的数组

  3. -
  4. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    +
  5. [iteratee=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

返回值 (Array)

-

Returns the new array.

+

返回新数组

示例

function duplicate(n) {
diff --git a/flatten.html b/flatten.html
index a5f4554..2e968e5 100644
--- a/flatten.html
+++ b/flatten.html
@@ -392,7 +392,7 @@
 
 
-

flatten source npm

+

flatten source npm

_.flatten(array)

Flattens array a single level.

diff --git a/flattenDeep.html b/flattenDeep.html index 4e9fc5b..8c0b69e 100644 --- a/flattenDeep.html +++ b/flattenDeep.html @@ -392,7 +392,7 @@
-

flattenDeep source npm

+

flattenDeep source npm

_.flattenDeep(array)

This method is like _.flatten except that it recursively flattens array.

diff --git a/flip.html b/flip.html index 4505c7d..707dedb 100644 --- a/flip.html +++ b/flip.html @@ -392,7 +392,7 @@
-

flip source npm

+

flip source npm

_.flip(func)

Creates a function that invokes func with arguments reversed.

diff --git a/floor.html b/floor.html index 9c27da3..3979032 100644 --- a/floor.html +++ b/floor.html @@ -392,7 +392,7 @@
-

floor source npm

+

floor source npm

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

Computes number rounded down to precision.

diff --git a/flow.html b/flow.html index 7377607..6d0fc65 100644 --- a/flow.html +++ b/flow.html @@ -392,7 +392,7 @@
-

flow source npm

+

flow source npm

_.flow([funcs])

Creates a function that returns the result of invoking the provided diff --git a/flowRight.html b/flowRight.html index 72f00c9..460dd61 100644 --- a/flowRight.html +++ b/flowRight.html @@ -392,7 +392,7 @@

-

flowRight source npm

+

flowRight source npm

_.flowRight([funcs])

This method is like _.flow except that it creates a function that diff --git a/forEach.html b/forEach.html index d49d872..f82a544 100644 --- a/forEach.html +++ b/forEach.html @@ -392,7 +392,7 @@

-

forEach each source npm

+

forEach each source npm

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

Iterates over elements of collection invoking iteratee for each element. diff --git a/forEachRight.html b/forEachRight.html index e16d933..f700d39 100644 --- a/forEachRight.html +++ b/forEachRight.html @@ -392,7 +392,7 @@

-

forEachRight eachRight source npm

+

forEachRight eachRight source npm

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

This method is like _.forEach except that it iterates over elements of diff --git a/forIn.html b/forIn.html index c64fc52..b796d4d 100644 --- a/forIn.html +++ b/forIn.html @@ -392,7 +392,7 @@

-

forIn source npm

+

forIn source npm

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

Iterates over own and inherited enumerable properties of an object invoking diff --git a/forInRight.html b/forInRight.html index 4564ce0..891b158 100644 --- a/forInRight.html +++ b/forInRight.html @@ -392,7 +392,7 @@

-

forInRight source npm

+

forInRight source npm

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

This method is like _.forIn except that it iterates over properties of diff --git a/forOwn.html b/forOwn.html index e34978d..0e5fd99 100644 --- a/forOwn.html +++ b/forOwn.html @@ -392,7 +392,7 @@

-

forOwn source npm

+

forOwn source npm

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

Iterates over own enumerable properties of an object invoking iteratee diff --git a/forOwnRight.html b/forOwnRight.html index 22efbaf..5d6dcb9 100644 --- a/forOwnRight.html +++ b/forOwnRight.html @@ -392,7 +392,7 @@

-

forOwnRight source npm

+

forOwnRight source npm

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

This method is like _.forOwn except that it iterates over properties of diff --git a/fromPairs.html b/fromPairs.html index fc61215..7c6ad82 100644 --- a/fromPairs.html +++ b/fromPairs.html @@ -392,7 +392,7 @@

-

fromPairs source npm

+

fromPairs source npm

_.fromPairs(pairs)

The inverse of _.toPairs; this method returns an object composed diff --git a/functions.html b/functions.html index 9bbf6e1..f86ee05 100644 --- a/functions.html +++ b/functions.html @@ -392,7 +392,7 @@

-

functions source npm

+

functions source npm

_.functions(object)

Creates an array of function property names from own enumerable properties diff --git a/functionsIn.html b/functionsIn.html index dd6ba8f..1abd242 100644 --- a/functionsIn.html +++ b/functionsIn.html @@ -392,7 +392,7 @@

-

functionsIn source npm

+

functionsIn source npm

_.functionsIn(object)

Creates an array of function property names from own and inherited diff --git a/get.html b/get.html index 1911614..8433ce7 100644 --- a/get.html +++ b/get.html @@ -392,7 +392,7 @@

-

get source npm

+

get source npm

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

Gets the value at path of object. If the resolved value is diff --git a/groupBy.html b/groupBy.html index 2b8e600..2cc97b7 100644 --- a/groupBy.html +++ b/groupBy.html @@ -392,7 +392,7 @@

-

groupBy source npm

+

groupBy source npm

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

Creates an object composed of keys generated from the results of running diff --git a/gt.html b/gt.html index 9124520..f8d04f4 100644 --- a/gt.html +++ b/gt.html @@ -392,7 +392,7 @@

-

gt source npm

+

gt source npm

_.gt(value, other)

Checks if value is greater than other.

diff --git a/gte.html b/gte.html index 20707dd..8d18d09 100644 --- a/gte.html +++ b/gte.html @@ -392,7 +392,7 @@
-

gte source npm

+

gte source npm

_.gte(value, other)

Checks if value is greater than or equal to other.

diff --git a/has.html b/has.html index f87d5ea..bdd6ca1 100644 --- a/has.html +++ b/has.html @@ -392,7 +392,7 @@
-

has source npm

+

has source npm

_.has(object, path)

Checks if path is a direct property of object.

diff --git a/hasIn.html b/hasIn.html index 6451529..01381ff 100644 --- a/hasIn.html +++ b/hasIn.html @@ -392,7 +392,7 @@
-

hasIn source npm

+

hasIn source npm

_.hasIn(object, path)

Checks if path is a direct or inherited property of object.

diff --git a/head.html b/head.html index 5014019..78fadb1 100644 --- a/head.html +++ b/head.html @@ -392,7 +392,7 @@
-

head first source npm

+

head first source npm

_.head(array)

Gets the first element of array.

diff --git a/identity.html b/identity.html index 4c0152f..6155d6b 100644 --- a/identity.html +++ b/identity.html @@ -392,7 +392,7 @@
-

identity source npm

+

identity source npm

_.identity(value)

This method returns the first argument provided to it.

diff --git a/inRange.html b/inRange.html index ff94a16..7a5cb2c 100644 --- a/inRange.html +++ b/inRange.html @@ -392,7 +392,7 @@
-

inRange source npm

+

inRange source npm

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

Checks if n is between start and up to but not including, end. If diff --git a/includes.html b/includes.html index b5314b5..fabaa69 100644 --- a/includes.html +++ b/includes.html @@ -392,7 +392,7 @@

-

includes source npm

+

includes source npm

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

Checks if value is in collection. If collection is a string it's checked diff --git a/indexOf.html b/indexOf.html index f472740..42dfac4 100644 --- a/indexOf.html +++ b/indexOf.html @@ -392,7 +392,7 @@

-

indexOf source npm

+

indexOf source npm

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

Gets the index at which the first occurrence of value is found in array diff --git a/initial.html b/initial.html index c5db069..5b80f2d 100644 --- a/initial.html +++ b/initial.html @@ -392,7 +392,7 @@

-

initial source npm

+

initial source npm

_.initial(array)

Gets all but the last element of array.

diff --git a/intersection.html b/intersection.html index 91b0ec1..b9402c3 100644 --- a/intersection.html +++ b/intersection.html @@ -392,7 +392,7 @@
-

intersection source npm

+

intersection source npm

_.intersection([arrays])

Creates an array of unique values that are included in all of the provided diff --git a/intersectionBy.html b/intersectionBy.html index f5049d2..b4eb4c6 100644 --- a/intersectionBy.html +++ b/intersectionBy.html @@ -392,7 +392,7 @@

-

intersectionBy source npm

+

intersectionBy source npm

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

This method is like _.intersection except that it accepts iteratee diff --git a/intersectionWith.html b/intersectionWith.html index 8f22627..e5e12a7 100644 --- a/intersectionWith.html +++ b/intersectionWith.html @@ -392,7 +392,7 @@

-

intersectionWith source npm

+

intersectionWith source npm

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

This method is like _.intersection except that it accepts comparator diff --git a/invert.html b/invert.html index 8fc2563..392b461 100644 --- a/invert.html +++ b/invert.html @@ -392,7 +392,7 @@

-

invert source npm

+

invert source npm

_.invert(object, [multiVal])

Creates an object composed of the inverted keys and values of object. diff --git a/invoke.html b/invoke.html index 0739511..36a1855 100644 --- a/invoke.html +++ b/invoke.html @@ -392,7 +392,7 @@

-

invoke source npm

+

invoke source npm

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

Invokes the method at path of object.

diff --git a/invokeMap.html b/invokeMap.html index c8e4475..c4bfe26 100644 --- a/invokeMap.html +++ b/invokeMap.html @@ -392,7 +392,7 @@
-

invokeMap source npm

+

invokeMap source npm

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

Invokes the method at path of each element in collection, returning diff --git a/isArguments.html b/isArguments.html index 5dc6e8a..8778288 100644 --- a/isArguments.html +++ b/isArguments.html @@ -392,7 +392,7 @@

-

isArguments source npm

+

isArguments source npm

_.isArguments(value)

Checks if value is likely an arguments object.

diff --git a/isArray.html b/isArray.html index c6a9f52..9d6b199 100644 --- a/isArray.html +++ b/isArray.html @@ -392,7 +392,7 @@
-

isArray source npm

+

isArray source npm

_.isArray(value)

Checks if value is classified as an Array object.

diff --git a/isArrayLike.html b/isArrayLike.html index a9d54a2..d14ae70 100644 --- a/isArrayLike.html +++ b/isArrayLike.html @@ -392,7 +392,7 @@
-

isArrayLike source npm

+

isArrayLike source npm

_.isArrayLike(value)

Checks if value is array-like. A value is considered array-like if it's diff --git a/isArrayLikeObject.html b/isArrayLikeObject.html index 87c4f43..b84ba8c 100644 --- a/isArrayLikeObject.html +++ b/isArrayLikeObject.html @@ -392,7 +392,7 @@

-

isArrayLikeObject source npm

+

isArrayLikeObject source npm

_.isArrayLikeObject(value)

This method is like _.isArrayLike except that it also checks if value diff --git a/isBoolean.html b/isBoolean.html index b96ec15..4f678d3 100644 --- a/isBoolean.html +++ b/isBoolean.html @@ -392,7 +392,7 @@

-

isBoolean source npm

+

isBoolean source npm

_.isBoolean(value)

Checks if value is classified as a boolean primitive or object.

diff --git a/isDate.html b/isDate.html index 07dc92c..8f20321 100644 --- a/isDate.html +++ b/isDate.html @@ -392,7 +392,7 @@
-

isDate source npm

+

isDate source npm

_.isDate(value)

Checks if value is classified as a Date object.

diff --git a/isElement.html b/isElement.html index db88160..ae45cb1 100644 --- a/isElement.html +++ b/isElement.html @@ -392,7 +392,7 @@
-

isElement source npm

+

isElement source npm

_.isElement(value)

Checks if value is likely a DOM element.

diff --git a/isEmpty.html b/isEmpty.html index bb1092c..17e665c 100644 --- a/isEmpty.html +++ b/isEmpty.html @@ -392,7 +392,7 @@
-

isEmpty source npm

+

isEmpty source npm

_.isEmpty(value)

Checks if value is empty. A value is considered empty unless it's an diff --git a/isEqual.html b/isEqual.html index 0b3df96..4aea01f 100644 --- a/isEqual.html +++ b/isEqual.html @@ -392,7 +392,7 @@

-

isEqual source npm

+

isEqual source npm

_.isEqual(value, other)

Performs a deep comparison between two values to determine if they are diff --git a/isEqualWith.html b/isEqualWith.html index 9479505..c7fe5ff 100644 --- a/isEqualWith.html +++ b/isEqualWith.html @@ -392,7 +392,7 @@

-

isEqualWith source npm

+

isEqualWith source npm

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

This method is like _.isEqual except that it accepts customizer which is diff --git a/isError.html b/isError.html index fb61408..96f1182 100644 --- a/isError.html +++ b/isError.html @@ -392,7 +392,7 @@

-

isError source npm

+

isError source npm

_.isError(value)

Checks if value is an Error, EvalError, RangeError, ReferenceError, diff --git a/isFinite.html b/isFinite.html index 975f67d..df4a9e1 100644 --- a/isFinite.html +++ b/isFinite.html @@ -392,7 +392,7 @@

-

isFinite source npm

+

isFinite source npm

_.isFinite(value)

Checks if value is a finite primitive number. diff --git a/isFunction.html b/isFunction.html index cae59cb..ee35552 100644 --- a/isFunction.html +++ b/isFunction.html @@ -392,7 +392,7 @@

-

isFunction source npm

+

isFunction source npm

_.isFunction(value)

Checks if value is classified as a Function object.

diff --git a/isInteger.html b/isInteger.html index 59b4650..d55035e 100644 --- a/isInteger.html +++ b/isInteger.html @@ -392,7 +392,7 @@
-

isInteger source npm

+

isInteger source npm

_.isInteger(value)

Checks if value is an integer. diff --git a/isLength.html b/isLength.html index c20f6a9..5dcc1ea 100644 --- a/isLength.html +++ b/isLength.html @@ -392,7 +392,7 @@

-

isLength source npm

+

isLength source npm

_.isLength(value)

Checks if value is a valid array-like length. diff --git a/isMatch.html b/isMatch.html index 034e762..d29fc75 100644 --- a/isMatch.html +++ b/isMatch.html @@ -392,7 +392,7 @@

-

isMatch source npm

+

isMatch source npm

_.isMatch(object, source)

Performs a deep comparison between object and source to determine if diff --git a/isMatchWith.html b/isMatchWith.html index 35c5b13..eb0b6ac 100644 --- a/isMatchWith.html +++ b/isMatchWith.html @@ -392,7 +392,7 @@

-

isMatchWith source npm

+

isMatchWith source npm

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

This method is like _.isMatch except that it accepts customizer which diff --git a/isNaN.html b/isNaN.html index 6fbc156..f3782b6 100644 --- a/isNaN.html +++ b/isNaN.html @@ -392,7 +392,7 @@

-

isNaN source npm

+

isNaN source npm

_.isNaN(value)

Checks if value is NaN. diff --git a/isNative.html b/isNative.html index ee9f99d..b9c0174 100644 --- a/isNative.html +++ b/isNative.html @@ -392,7 +392,7 @@

-

isNative source npm

+

isNative source npm

_.isNative(value)

Checks if value is a native function.

diff --git a/isNil.html b/isNil.html index 15d8e0a..9796d33 100644 --- a/isNil.html +++ b/isNil.html @@ -392,7 +392,7 @@
-

isNil source npm

+

isNil source npm

_.isNil(value)

Checks if value is null or undefined.

diff --git a/isNull.html b/isNull.html index 1cbf787..2da265d 100644 --- a/isNull.html +++ b/isNull.html @@ -392,7 +392,7 @@
-

isNull source npm

+

isNull source npm

_.isNull(value)

Checks if value is null.

diff --git a/isNumber.html b/isNumber.html index e861618..8fb8557 100644 --- a/isNumber.html +++ b/isNumber.html @@ -392,7 +392,7 @@
-

isNumber source npm

+

isNumber source npm

_.isNumber(value)

Checks if value is classified as a Number primitive or object. diff --git a/isObject.html b/isObject.html index b5d25ce..1d7d15e 100644 --- a/isObject.html +++ b/isObject.html @@ -392,7 +392,7 @@

-

isObject source npm

+

isObject source npm

_.isObject(value)

Checks if value is the language type of Object. diff --git a/isObjectLike.html b/isObjectLike.html index 84e5e62..bd24727 100644 --- a/isObjectLike.html +++ b/isObjectLike.html @@ -392,7 +392,7 @@

-

isObjectLike source npm

+

isObjectLike source npm

_.isObjectLike(value)

Checks if value is object-like. A value is object-like if it's not null diff --git a/isPlainObject.html b/isPlainObject.html index 990b03b..e5e0b47 100644 --- a/isPlainObject.html +++ b/isPlainObject.html @@ -392,7 +392,7 @@

-

isPlainObject source npm

+

isPlainObject source npm

_.isPlainObject(value)

Checks if value is a plain object, that is, an object created by the diff --git a/isRegExp.html b/isRegExp.html index 0384b96..434d5b9 100644 --- a/isRegExp.html +++ b/isRegExp.html @@ -392,7 +392,7 @@

-

isRegExp source npm

+

isRegExp source npm

_.isRegExp(value)

Checks if value is classified as a RegExp object.

diff --git a/isSafeInteger.html b/isSafeInteger.html index 3a23428..5f2842b 100644 --- a/isSafeInteger.html +++ b/isSafeInteger.html @@ -392,7 +392,7 @@
-

isSafeInteger source npm

+

isSafeInteger source npm

_.isSafeInteger(value)

Checks if value is a safe integer. An integer is safe if it's an IEEE-754 diff --git a/isString.html b/isString.html index 3f27a45..1f379e1 100644 --- a/isString.html +++ b/isString.html @@ -392,7 +392,7 @@

-

isString source npm

+

isString source npm

_.isString(value)

Checks if value is classified as a String primitive or object.

diff --git a/isSymbol.html b/isSymbol.html index 3e90b66..4d46ea1 100644 --- a/isSymbol.html +++ b/isSymbol.html @@ -392,7 +392,7 @@
-

isSymbol source npm

+

isSymbol source npm

_.isSymbol(value)

Checks if value is classified as a Symbol primitive or object.

diff --git a/isTypedArray.html b/isTypedArray.html index 342a81d..1f8000b 100644 --- a/isTypedArray.html +++ b/isTypedArray.html @@ -392,7 +392,7 @@
-

isTypedArray source npm

+

isTypedArray source npm

_.isTypedArray(value)

Checks if value is classified as a typed array.

diff --git a/isUndefined.html b/isUndefined.html index bea1512..352feb6 100644 --- a/isUndefined.html +++ b/isUndefined.html @@ -392,7 +392,7 @@
-

isUndefined source npm

+

isUndefined source npm

_.isUndefined(value)

Checks if value is undefined.

diff --git a/iteratee.html b/iteratee.html index 7818e31..9c99ab5 100644 --- a/iteratee.html +++ b/iteratee.html @@ -392,7 +392,7 @@
-

iteratee source npm

+

iteratee source npm

_.iteratee([func=_.identity])

Creates a function that invokes func with the arguments of the created diff --git a/join.html b/join.html index b3709fc..a2f9aa4 100644 --- a/join.html +++ b/join.html @@ -392,7 +392,7 @@

-

join source npm

+

join source npm

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

Converts all elements in array into a string separated by separator.

diff --git a/js/lodash-zh.js b/js/lodash-zh.js index 247eaf8..7af3cdf 100644 --- a/js/lodash-zh.js +++ b/js/lodash-zh.js @@ -7,7 +7,6 @@ * Available under MIT license */ ;(function () { - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined; @@ -2282,7 +2281,7 @@ * @returns {Function} Returns the new function. */ function baseConforms (source) { - var props = keysIn(source), + var props = keys(source), length = props.length; return function (object) { @@ -4868,7 +4867,7 @@ */ function initCloneArray (array) { var length = array.length, - result = new array.constructor(length); + result = array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { @@ -4887,7 +4886,7 @@ */ function initCloneObject (object) { var Ctor = object.constructor; - return (typeof Ctor == 'function' && Ctor instanceof Ctor) ? new Ctor : {}; + return baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined); } /** @@ -5270,8 +5269,8 @@ /*------------------------------------------------------------------------*/ /** - * 将 array 拆分成多个 size 长度的块,并组成一个新数组。 - * 如果 array 无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。 + * 将数组拆分成多个 size 长度的块,并组成一个新数组。 + * 如果数组无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。 * * @static * @memberOf _ @@ -5305,14 +5304,14 @@ } /** - * Creates an array with all falsey values removed. The values `false`, `null`, - * `0`, `""`, `undefined`, and `NaN` are falsey. + * 创建一个移除了所有假值的数组。例如:`false`、`null`、 + * `0`、`""`、`undefined`, 以及`NaN` 都是 “假值”. * * @static * @memberOf _ * @category Array - * @param {Array} array The array to compact. - * @returns {Array} Returns the new array of filtered values. + * @param {Array} array 需要被处理的数组。 + * @returns {Array} 返回移除了假值的数组。 * @example * * _.compact([0, 1, false, 2, '', 3]); @@ -5334,15 +5333,14 @@ } /** - * Creates a new array concatenating `array` with any additional arrays - * and/or values. + * 创建一个用任何数组 或 值连接的新数组。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to concatenate. - * @param {...*} [values] The values to concatenate. - * @returns {Array} Returns the new concatenated array. + * @param {Array} array 需要被连接的数组 + * @param {...*} [values] 需要被连接的值的队列 + * @returns {Array} 返回连接后的新数组 * @example * * var array = [1]; @@ -5360,16 +5358,14 @@ }); /** - * Creates an array of unique `array` values not included in the other - * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. + * 创建一个差异化后的数组,不包括使用 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) 方法提供的数组。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @returns {Array} Returns the new array of filtered values. + * @param {Array} array 需要处理的数组 + * @param {...Array} [values] 用于对比差异的数组 + * @returns {Array} 返回一个差异化后的新数组 * @example * * _.difference([3, 2, 1], [4, 2]); @@ -5382,23 +5378,21 @@ }); /** - * 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 uniqueness is computed. The iteratee is invoked with one argument: (value). + * 这个方法类似 `_.difference`,除了它接受一个 iteratee 调用每一个数组和值。iteratee 会传入一个参数:(value)。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function|Object|string} [iteratee=_.identity] The iteratee invoked per element. - * @returns {Array} Returns the new array of filtered values. + * @param {Array} array 需要处理的数组 + * @param {...Array} [values] 用于对比差异的数组 + * @param {Function|Object|string} [iteratee=_.identity] 这个函数会调用每一个元素 + * @returns {Array} 返回一个差异化后的新数组 * @example * * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor); * // => [3.1, 1.3] * - * // using the `_.property` callback shorthand + * // 使用了 `_.property` 的回调结果 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ @@ -5413,17 +5407,15 @@ }); /** - * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. The comparator - * is invoked with two arguments: (arrVal, othVal). + * 这个方法类似 `_.difference`,除了它接受一个 comparator 调用每一个数组元素的值。 comparator 会传入2个参数:(arrVal, othVal)。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to inspect. - * @param {...Array} [values] The values to exclude. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. + * @param {Array} array 需要处理的数组 + * @param {...Array} [values] 用于对比差异的数组 + * @param {Function} [comparator] 这个函数会调用每一个元素 + * @returns {Array} 返回一个差异化后的新数组 * @example * * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; @@ -5442,15 +5434,15 @@ }); /** - * Creates a slice of `array` with `n` elements dropped from the beginning. + * 裁剪数组中的前 N 个数组,返回剩余的部分。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. + * @param {Array} array 需要处理的数组 + * @param {number} [n=1] 裁剪的个数 * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. + * @returns {Array} 返回数组的剩余的部分。 * @example * * _.drop([1, 2, 3]); @@ -5474,15 +5466,15 @@ } /** - * Creates a slice of `array` with `n` elements dropped from the end. + * 从右边开始裁剪数组中的 N 个数组,返回剩余的部分。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to query. - * @param {number} [n=1] The number of elements to drop. + * @param {Array} array 需要处理的数组 + * @param {number} [n=1] 裁剪的个数 * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. - * @returns {Array} Returns the slice of `array`. + * @returns {Array} 返回数组的剩余的部分。 * @example * * _.dropRight([1, 2, 3]); @@ -5508,16 +5500,14 @@ } /** - * 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). + * 从右边开始裁剪数组,起点从 `predicate` 返回假值开始。`predicate` 会传入3个参数:(value, index, array)。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {Array} Returns the slice of `array`. + * @param {Array} array 需要处理的数组 + * @param {Function|Object|string} [predicate=_.identity] 这个函数会在每一次迭代调用 + * @returns {Array} 返回裁剪后的数组 * @example * * var resolve = _.partial(_.map, _, 'user'); @@ -5531,15 +5521,15 @@ * resolve( _.dropRightWhile(users, function(o) { return !o.active; }) ); * // => ['barney'] * - * // using the `_.matches` callback shorthand + * // 使用了 `_.matches` 的回调结果 * resolve( _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }) ); * // => ['barney', 'fred'] * - * // using the `_.matchesProperty` callback shorthand + * // 使用了 `_.matchesProperty` 的回调结果 * resolve( _.dropRightWhile(users, ['active', false]) ); * // => ['barney'] * - * // using the `_.property` callback shorthand + * // 使用了 `_.property` 的回调结果 * resolve( _.dropRightWhile(users, 'active') ); * // => ['barney', 'fred', 'pebbles'] */ @@ -5550,15 +5540,13 @@ } /** - * 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). + * 裁剪数组,起点从 `predicate` 返回假值开始。`predicate` 会传入3个参数:(value, index, array)。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to query. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. + * @param {Array} array array 需要处理的数组 + * @param {Function|Object|string} [predicate=_.identity] 这个函数会在每一次迭代调用 * @returns {Array} Returns the slice of `array`. * @example * @@ -5573,15 +5561,15 @@ * resolve( _.dropWhile(users, function(o) { return !o.active; }) ); * // => ['pebbles'] * - * // using the `_.matches` callback shorthand + * // 使用了 `_.matches` 的回调结果 * resolve( _.dropWhile(users, { 'user': 'barney', 'active': false }) ); * // => ['fred', 'pebbles'] * - * // using the `_.matchesProperty` callback shorthand + * // 使用了 `_.matchesProperty` 的回调结果 * resolve( _.dropWhile(users, ['active', false]) ); * // => ['pebbles'] * - * // using the `_.property` callback shorthand + * // 使用了 `_.property` 的回调结果 * resolve( _.dropWhile(users, 'active') ); * // => ['barney', 'fred', 'pebbles'] */ @@ -5592,19 +5580,18 @@ } /** - * Fills elements of `array` with `value` from `start` up to, but not - * including, `end`. + * 指定 `值` 填充数组,从 `start` 到 `end` 的位置,但不包括 `end` 本身的位置。 * - * **Note:** This method mutates `array`. + * **注意:** 这个方法会改变数组 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to fill. - * @param {*} value The value to fill `array` with. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns `array`. + * @param {Array} array 需要填充的数组 + * @param {*} value 填充的值 + * @param {number} [start=0] 开始位置 + * @param {number} [end=array.length] 结束位置 + * @returns {Array} 返回数组 * @example * * var array = [1, 2, 3]; @@ -5632,15 +5619,14 @@ } /** - * This method is like `_.find` except that it returns the index of the first - * element `predicate` returns truthy for instead of the element itself. - * + * 这个方法类似 `_.find`。除了它返回最先通过 `predicate` 判断为真值的元素的 index ,而不是元素本身。 + * * @static * @memberOf _ * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {number} Returns the index of the found element, else `-1`. + * @param {Array} array 需要搜索的数组 + * @param {Function|Object|string} [predicate=_.identity] 这个函数会在每一次迭代调用 + * @returns {number} 返回符合元素的 index,否则返回 `-1`。 * @example * * var users = [ @@ -5652,15 +5638,15 @@ * _.findIndex(users, function(o) { return o.user == 'barney'; }); * // => 0 * - * // using the `_.matches` callback shorthand + * // 使用了 `_.matches` 的回调结果 * _.findIndex(users, { 'user': 'fred', 'active': false }); * // => 1 * - * // using the `_.matchesProperty` callback shorthand + * // 使用了 `_.matchesProperty` 的回调结果 * _.findIndex(users, ['active', false]); * // => 0 * - * // using the `_.property` callback shorthand + * // 使用了 `_.property` 的回调结果 * _.findIndex(users, 'active'); * // => 2 */ @@ -5671,15 +5657,14 @@ } /** - * This method is like `_.findIndex` except that it iterates over elements - * of `collection` from right to left. + * 这个方式类似 `_.findIndex` , 不过它是从右到左迭代的。 * * @static * @memberOf _ * @category Array - * @param {Array} array The array to search. - * @param {Function|Object|string} [predicate=_.identity] The function invoked per iteration. - * @returns {number} Returns the index of the found element, else `-1`. + * @param {Array} array 需要搜索的数组 + * @param {Function|Object|string} [predicate=_.identity] 这个函数会在每一次迭代调用 + * @returns {number} 返回符合元素的 index,否则返回 `-1`。 * @example * * var users = [ @@ -5691,15 +5676,15 @@ * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); * // => 2 * - * // using the `_.matches` callback shorthand + * // 使用了 `_.matches` 的回调结果 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); * // => 0 * - * // using the `_.matchesProperty` callback shorthand + * // 使用了 `_.matchesProperty` 的回调结果 * _.findLastIndex(users, ['active', false]); * // => 2 * - * // using the `_.property` callback shorthand + * // 使用了 `_.property` 的回调结果 * _.findLastIndex(users, 'active'); * // => 0 */ @@ -5710,16 +5695,14 @@ } /** - * Creates an array of flattened values by running each element in `array` - * through `iteratee` and concating its result to the other mapped values. - * The iteratee is invoked with three arguments: (value, index|key, array). - * + * 创建一个扁平化的数组,每一个值会传入 `iteratee` 处理,处理结果会与值合并。 + * iteratee 会传入3个参数:(value, index|key, array)。 * @static * @memberOf _ * @category Array - * @param {Array} array The array to iterate over. - * @param {Function|Object|string} [iteratee=_.identity] The function invoked per iteration. - * @returns {Array} Returns the new array. + * @param {Array} array 遍历用的数组 + * @param {Function|Object|string} [iteratee=_.identity] 这个函数会在每一次迭代调用 + * @returns {Array} 返回新数组 * @example * * function duplicate(n) { @@ -9113,11 +9096,10 @@ * **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 and objects created - * by constructors other than `Object` are cloned as plain `Object` objects. - * An empty object is returned for uncloneable values such as error objects, - * functions, DOM nodes, and WeakMaps. + * 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. * * @static * @memberOf _ @@ -12330,7 +12312,7 @@ * @param {RegExp} [options.interpolate] The "interpolate" delimiter. * @param {string} [options.sourceURL] The sourceURL of the template's compiled source. * @param {string} [options.variable] The data object variable name. - * @param- {Object} [otherOptions] Enables the legacy `options` param signature. + * @param- {Object} [guard] Enables use as an iteratee for functions like `_.map`. * @returns {Function} Returns the compiled template function. * @example * @@ -12398,16 +12380,16 @@ * };\ * '); */ - function template (string, options, otherOptions) { + function template(string, options, guard) { // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/) // and Laura Doktorova's doT.js (https://github.com/olado/doT). var settings = lodash.templateSettings; - if (otherOptions && isIterateeCall(string, options, otherOptions)) { - options = otherOptions = undefined; + if (guard && isIterateeCall(string, options, guard)) { + options = undefined; } string = toString(string); - options = assignInWith({}, otherOptions || options, settings, assignInDefaults); + options = assignInWith({}, options, settings, assignInDefaults); var imports = assignInWith({}, options.imports, settings.imports, assignInDefaults), importsKeys = keys(imports), @@ -14482,7 +14464,7 @@ else if (freeExports && freeModule) { // Export for Node.js. if (moduleExports) { - (freeModule.exports = _)._ = _ + (freeModule.exports = _)._ = _; } // Export for CommonJS support. freeExports._ = _; diff --git a/kebabCase.html b/kebabCase.html index 75f2b62..29ab1a4 100644 --- a/kebabCase.html +++ b/kebabCase.html @@ -392,7 +392,7 @@
-

kebabCase source npm

+

kebabCase source npm

_.kebabCase([string=''])

Converts string to kebab case.

diff --git a/keyBy.html b/keyBy.html index f64358f..9d80718 100644 --- a/keyBy.html +++ b/keyBy.html @@ -392,7 +392,7 @@
-

keyBy source npm

+

keyBy source npm

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

Creates an object composed of keys generated from the results of running diff --git a/keys.html b/keys.html index 973e00c..1f7814f 100644 --- a/keys.html +++ b/keys.html @@ -392,7 +392,7 @@

-

keys source npm

+

keys source npm

_.keys(object)

Creates an array of the own enumerable property names of object. diff --git a/keysIn.html b/keysIn.html index 0072010..fa32b44 100644 --- a/keysIn.html +++ b/keysIn.html @@ -392,7 +392,7 @@

-

keysIn source npm

+

keysIn source npm

_.keysIn(object)

Creates an array of the own and inherited enumerable property names of object. diff --git a/last.html b/last.html index 2173713..26f800a 100644 --- a/last.html +++ b/last.html @@ -392,7 +392,7 @@

-

last source npm

+

last source npm

_.last(array)

Gets the last element of array.

diff --git a/lastIndexOf.html b/lastIndexOf.html index d79433c..0e0e460 100644 --- a/lastIndexOf.html +++ b/lastIndexOf.html @@ -392,7 +392,7 @@
-

lastIndexOf source npm

+

lastIndexOf source npm

_.lastIndexOf(array, value, [fromIndex=array.length-1])

This method is like _.indexOf except that it iterates over elements of diff --git a/lowerCase.html b/lowerCase.html index 868c568..3410b9e 100644 --- a/lowerCase.html +++ b/lowerCase.html @@ -392,7 +392,7 @@

-

lowerCase source npm

+

lowerCase source npm

_.lowerCase([string=''])

Converts string, as space separated words, to lower case.

diff --git a/lowerFirst.html b/lowerFirst.html index 5fd9f75..235b065 100644 --- a/lowerFirst.html +++ b/lowerFirst.html @@ -392,7 +392,7 @@
-

lowerFirst source npm

+

lowerFirst source npm

_.lowerFirst([string=''])

Converts the first character of string to lower case.

diff --git a/lt.html b/lt.html index 4243a20..b016ba2 100644 --- a/lt.html +++ b/lt.html @@ -392,7 +392,7 @@
-

lt source npm

+

lt source npm

_.lt(value, other)

Checks if value is less than other.

diff --git a/lte.html b/lte.html index 631c320..775c3cc 100644 --- a/lte.html +++ b/lte.html @@ -392,7 +392,7 @@
-

lte source npm

+

lte source npm

_.lte(value, other)

Checks if value is less than or equal to other.

diff --git a/map.html b/map.html index 666ab9d..85ed7fc 100644 --- a/map.html +++ b/map.html @@ -392,7 +392,7 @@
-

map source npm

+

map source npm

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

Creates an array of values by running each element in collection through diff --git a/mapKeys.html b/mapKeys.html index 51b8537..0be8c42 100644 --- a/mapKeys.html +++ b/mapKeys.html @@ -392,7 +392,7 @@

-

mapKeys source npm

+

mapKeys source npm

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

The opposite of _.mapValues; this method creates an object with the diff --git a/mapValues.html b/mapValues.html index 73bbbec..f86496b 100644 --- a/mapValues.html +++ b/mapValues.html @@ -392,7 +392,7 @@

-

mapValues source npm

+

mapValues source npm

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

Creates an object with the same keys as object and values generated by diff --git a/matches.html b/matches.html index 8f6374d..831671b 100644 --- a/matches.html +++ b/matches.html @@ -392,7 +392,7 @@

-

matches source npm

+

matches source npm

_.matches(source)

Creates a function that performs a deep partial comparison between a given diff --git a/matchesProperty.html b/matchesProperty.html index c0a936d..53509e8 100644 --- a/matchesProperty.html +++ b/matchesProperty.html @@ -392,7 +392,7 @@

-

matchesProperty source npm

+

matchesProperty source npm

_.matchesProperty(path, srcValue)

Creates a function that performs a deep partial comparison between the diff --git a/max.html b/max.html index a11a955..0c8c8c5 100644 --- a/max.html +++ b/max.html @@ -392,7 +392,7 @@

-

max source npm

+

max source npm

_.max(array)

Computes the maximum value of array. If array is empty or falsey diff --git a/maxBy.html b/maxBy.html index 46e5e81..05d2400 100644 --- a/maxBy.html +++ b/maxBy.html @@ -392,7 +392,7 @@

-

maxBy source npm

+

maxBy source npm

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

This method is like _.max except that it accepts iteratee which is diff --git a/mean.html b/mean.html index bed230e..50640c2 100644 --- a/mean.html +++ b/mean.html @@ -392,7 +392,7 @@

-

mean source npm

+

mean source npm

_.mean(array)

Computes the mean of the values in array.

diff --git a/memoize.html b/memoize.html index dc83aad..bbc761a 100644 --- a/memoize.html +++ b/memoize.html @@ -392,7 +392,7 @@
-

memoize source npm

+

memoize source npm

_.memoize(func, [resolver])

Creates a function that memoizes the result of func. If resolver is diff --git a/merge.html b/merge.html index b89bfa6..8e87510 100644 --- a/merge.html +++ b/merge.html @@ -392,7 +392,7 @@

-

merge source npm

+

merge source npm

_.merge(object, [sources])

Recursively merges own and inherited enumerable properties of source diff --git a/mergeWith.html b/mergeWith.html index d861a7f..992dab1 100644 --- a/mergeWith.html +++ b/mergeWith.html @@ -392,7 +392,7 @@

-

mergeWith source npm

+

mergeWith source npm

_.mergeWith(object, sources, customizer)

This method is like _.merge except that it accepts customizer which diff --git a/method.html b/method.html index a41bb33..b396951 100644 --- a/method.html +++ b/method.html @@ -392,7 +392,7 @@

-

method source npm

+

method source npm

_.method(path, [args])

Creates a function that invokes the method at path of a given object. diff --git a/methodOf.html b/methodOf.html index e74d8a3..e784bc8 100644 --- a/methodOf.html +++ b/methodOf.html @@ -392,7 +392,7 @@

-

methodOf source npm

+

methodOf source npm

_.methodOf(object, [args])

The opposite of _.method; this method creates a function that invokes diff --git a/min.html b/min.html index 7662c22..df839d8 100644 --- a/min.html +++ b/min.html @@ -392,7 +392,7 @@

-

min source npm

+

min source npm

_.min(array)

Computes the minimum value of array. If array is empty or falsey diff --git a/minBy.html b/minBy.html index 610db14..9ca8c1d 100644 --- a/minBy.html +++ b/minBy.html @@ -392,7 +392,7 @@

-

minBy source npm

+

minBy source npm

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

This method is like _.min except that it accepts iteratee which is diff --git a/mixin.html b/mixin.html index f17d0fc..1fa25ab 100644 --- a/mixin.html +++ b/mixin.html @@ -392,7 +392,7 @@

-

mixin source npm

+

mixin source npm

_.mixin([object=lodash], source, [options])

Adds all own enumerable function properties of a source object to the diff --git a/negate.html b/negate.html index fbfe04d..776f22e 100644 --- a/negate.html +++ b/negate.html @@ -392,7 +392,7 @@

-

negate source npm

+

negate source npm

_.negate(predicate)

Creates a function that negates the result of the predicate func. The diff --git a/noConflict.html b/noConflict.html index 8e579c4..6538c1a 100644 --- a/noConflict.html +++ b/noConflict.html @@ -392,7 +392,7 @@

-

noConflict source npm

+

noConflict source npm

_.noConflict()

Reverts the _ variable to its previous value and returns a reference to diff --git a/noop.html b/noop.html index 86396c6..c9c1a36 100644 --- a/noop.html +++ b/noop.html @@ -392,7 +392,7 @@

-

noop source npm

+

noop source npm

_.noop()

A no-operation function that returns undefined regardless of the diff --git a/now.html b/now.html index ef7e795..a559784 100644 --- a/now.html +++ b/now.html @@ -392,7 +392,7 @@

-

now source npm

+

now source npm

_.now()

Gets the timestamp of the number of milliseconds that have elapsed since diff --git a/nthArg.html b/nthArg.html index 400ef3f..6d211e7 100644 --- a/nthArg.html +++ b/nthArg.html @@ -392,7 +392,7 @@

-

nthArg source npm

+

nthArg source npm

_.nthArg([n=0])

Creates a function that returns its nth argument.

diff --git a/omit.html b/omit.html index 8a2ca05..69453a0 100644 --- a/omit.html +++ b/omit.html @@ -392,7 +392,7 @@
-

omit source npm

+

omit source npm

_.omit(object, [props])

The opposite of _.pick; this method creates an object composed of the diff --git a/omitBy.html b/omitBy.html index 559134c..79e3cb3 100644 --- a/omitBy.html +++ b/omitBy.html @@ -392,7 +392,7 @@

-

omitBy source npm

+

omitBy source npm

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

The opposite of _.pickBy; this method creates an object composed of the diff --git a/once.html b/once.html index f6b4311..659960e 100644 --- a/once.html +++ b/once.html @@ -392,7 +392,7 @@

-

once source npm

+

once source npm

_.once(func)

Creates a function that is restricted to invoking func once. Repeat calls diff --git a/orderBy.html b/orderBy.html index 704014b..7c3f45b 100644 --- a/orderBy.html +++ b/orderBy.html @@ -392,7 +392,7 @@

-

orderBy source npm

+

orderBy source npm

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

This method is like _.sortBy except that it allows specifying the sort diff --git a/over.html b/over.html index 2f2afa3..c6abcc6 100644 --- a/over.html +++ b/over.html @@ -392,7 +392,7 @@

-

over source npm

+

over source npm

_.over(iteratees)

Creates a function that invokes iteratees with the arguments provided diff --git a/overArgs.html b/overArgs.html index 63db32b..9144167 100644 --- a/overArgs.html +++ b/overArgs.html @@ -392,7 +392,7 @@

-

overArgs source npm

+

overArgs source npm

_.overArgs(func, [transforms])

Creates a function that invokes func with arguments transformed by diff --git a/overEvery.html b/overEvery.html index 3896e0e..10b487b 100644 --- a/overEvery.html +++ b/overEvery.html @@ -392,7 +392,7 @@

-

overEvery source npm

+

overEvery source npm

_.overEvery(predicates)

Creates a function that checks if all of the predicates return diff --git a/overSome.html b/overSome.html index c8baf43..8b47835 100644 --- a/overSome.html +++ b/overSome.html @@ -392,7 +392,7 @@

-

overSome source npm

+

overSome source npm

_.overSome(predicates)

Creates a function that checks if any of the predicates return diff --git a/pad.html b/pad.html index 7ecf0b2..e37b0d7 100644 --- a/pad.html +++ b/pad.html @@ -392,7 +392,7 @@

-

pad source npm

+

pad source npm

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

Pads string on the left and right sides if it's shorter than length. diff --git a/padEnd.html b/padEnd.html index 0973f09..bfe0e13 100644 --- a/padEnd.html +++ b/padEnd.html @@ -392,7 +392,7 @@

-

padEnd source npm

+

padEnd source npm

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

Pads string on the right side if it's shorter than length. Padding diff --git a/padStart.html b/padStart.html index 8bcb031..9e6a3ed 100644 --- a/padStart.html +++ b/padStart.html @@ -392,7 +392,7 @@

-

padStart source npm

+

padStart source npm

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

Pads string on the left side if it's shorter than length. Padding diff --git a/pages.json b/pages.json index 6e575da..cbfa4ed 100644 --- a/pages.json +++ b/pages.json @@ -5,581 +5,581 @@ ,{ "href":"/custom-builds", "html":"

版本定制

\n

通过版本定制可以很轻松的定制仅包含你所需功能的 lodash 版本 。更棒的是,我们已经帮你处理好了函数依赖和别名对应,查看 版本区别 & 选择一个适合你的版本。

\n

使用 Grunt? 我们准备了 Grunt plugin 协助构建 lodash。

\n

安装 lodash-cli 来作为 lodash 全局命令行工具:

\n
$ {sudo -H} npm i -g npm\n$ {sudo -H} npm i -g lodash-cli\n$ lodash -h\n

注意: 请先卸载旧版本,再安装 lodash-cli

\n
    \n
  • 兼容版本构建,同时支持新旧运行环境,使用 compat 修饰。 (默认)
  • \n
\n
lodash compat\n
    \n
  • 现代版本构建,针对新的环境,包括 ES5/ES6 支持,使用 modern 修饰。
  • \n
\n
lodash modern\n
    \n
  • 严格模式版本构建, 开启 ES 严格模式,使用 strict 修饰。
  • \n
\n
lodash strict\n
    \n
  • 模块化版本构建,拆散 lodash 为各个模块,使用 modularize 修饰。
  • \n
\n
lodash modularize\n

构建命令:

\n
    \n
  • 使用 category 命令以逗号分隔的方式传入需要的函数分类。可用的函数分类有: “array”, “chain”, “collection”, “date”, “function”, “lang”, “object”, “number”, “string”, & “utility”=。
  • \n
\n
lodash category=collection,function\n
    \n
  • 使用 exports 命令以逗号分隔的方式传入导出 lodash 函数的方式,可用的方式有: “amd”, “commonjs”, “es”, “global”, “iojs”, “node”, “npm”, “none”, & “umd”.
  • \n
\n
lodash exports=amd,commonjs,iojs\n
    \n
  • 使用 iife 命令指定代码替换 包裹 lodash 的 IIFE
  • \n
\n
lodash iife="!function(window,undefined){%output%}(this)"\n
    \n
  • 使用 include 命令以逗号分隔的方式传入需要包含的函数。
  • \n
\n
lodash include=each,filter,map\n
    \n
  • 使用 minus 命令以逗号分隔的方式传入需要删减的函数/分类。
  • \n
\n
lodash modern minus=result,shuffle\n
    \n
  • 使用 plus 命令以逗号分隔的方式传入需要补充的函数/分类。
  • \n
\n
lodash category=array plus=random,template\n
    \n
  • 使用 template 命令传入路径相匹配的文件生成预编译模板。 注意: 预编译模板分配在 _.templates 对象上。
  • \n
\n
lodash template="./*.jst"\n
    \n
  • 使用 settings 命令设置预编译模板时的模板语法。
  • \n
\n
lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}"\n
    \n
  • 使用 moduleId 命令指定 lodash 的 AMD module ID 或 包含 lodash 的编译模板的 module ID。指定为 none 表示创建编译模板不依赖 lodash。
  • \n
\n
lodash moduleId=underscore\n

注意:

\n
    \n
  • 所有命令可以组合(除了 compat & modern
  • \n
  • exports 的值 “es” & “npm” 只能与 modularize 命令联用。
  • \n
  • modularize 命令使用最先的 exports 的值作为模块格式,忽略后续的值。
  • \n
  • 除非指定 -o--output,不然所有文件会保存在当前工作目录。
  • \n
  • Node.js 0.10.8-0.10.11 存在 bugs 导致无法最小化构建。
  • \n
\n

另外还支持以下选项:

\n
-c, --stdout .......... 输出到stdout(译注:类似直接输出在终端那样)\n-d, --development ..... 输出非最小化的开发代码\n-h, --help ............ 显示帮助信息\n-m, --source-map ...... 生成source-map文件\n-o, --output .......... 指定输出的路径/文件名\n-p, --production ...... 输出最小化后的产品代码\n-s, --silent .......... 不显示常规的日志输出\n-V, --version ......... 显示当前的 lodash 版本号\n
\n
" } ,{ "href":"/chunk", - "html":"

chunk source npm

\n
_.chunk(array, [size=0])
\n\n

将 array 拆分成多个 size 长度的块,并组成一个新数组。\n如果 array 无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要被处理的数组

    \n
  2. \n
  3. [size=0] (number)

    每个块的长度

    \n
  4. \n
\n

返回值 (Array)

\n

返回一个拆分好的新数组

\n
\n

示例

\n
_.chunk(['a', 'b', 'c', 'd'], 2);\n// => [['a', 'b'], ['c', 'd']]\n\n_.chunk(['a', 'b', 'c', 'd'], 3);\n// => [['a', 'b', 'c'], ['d']]\n
\n
\n
" } + "html":"

chunk source npm

\n
_.chunk(array, [size=0])
\n\n

将数组拆分成多个 size 长度的块,并组成一个新数组。\n如果数组无法被分割成全部等长的块,那么最后剩余的元素将组成一个块。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要被处理的数组

    \n
  2. \n
  3. [size=0] (number)

    每个块的长度

    \n
  4. \n
\n

返回值 (Array)

\n

返回一个拆分好的新数组

\n
\n

示例

\n
_.chunk(['a', 'b', 'c', 'd'], 2);\n// => [['a', 'b'], ['c', 'd']]\n\n_.chunk(['a', 'b', 'c', 'd'], 3);\n// => [['a', 'b', 'c'], ['d']]\n
\n
\n
" } ,{ "href":"/compact", - "html":"

compact source npm

\n
_.compact(array)
\n\n

Creates an array with all falsey values removed. The values false, null,\n0, "", undefined, and NaN are falsey.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to compact.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of filtered values.

\n
\n

示例

\n
_.compact([0, 1, false, 2, '', 3]);\n// => [1, 2, 3]\n
\n
\n
" } + "html":"

compact source npm

\n
_.compact(array)
\n\n

创建一个移除了所有假值的数组。例如:falsenull、\n0""undefined, 以及NaN 都是 “假值”.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要被处理的数组。

    \n
  2. \n
\n

返回值 (Array)

\n

返回移除了假值的数组。

\n
\n

示例

\n
_.compact([0, 1, false, 2, '', 3]);\n// => [1, 2, 3]\n
\n
\n
" } ,{ "href":"/concat", - "html":"

concat source npm

\n
_.concat(array, [values])
\n\n

Creates a new array concatenating array with any additional arrays\nand/or values.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to concatenate.

    \n
  2. \n
  3. [values] (...*)

    The values to concatenate.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new concatenated array.

\n
\n

示例

\n
var array = [1];\nvar other = _.concat(array, 2, [3], [[4]]);\n\nconsole.log(other);\n// => [1, 2, 3, [4]]\n\nconsole.log(array);\n// => [1]\n
\n
\n
" } + "html":"

concat source npm

\n
_.concat(array, [values])
\n\n

创建一个用任何数组 或 值连接的新数组。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要被连接的数组

    \n
  2. \n
  3. [values] (...*)

    需要被连接的值的队列

    \n
  4. \n
\n

返回值 (Array)

\n

返回连接后的新数组

\n
\n

示例

\n
var array = [1];\nvar other = _.concat(array, 2, [3], [[4]]);\n\nconsole.log(other);\n// => [1, 2, 3, [4]]\n\nconsole.log(array);\n// => [1]\n
\n
\n
" } ,{ "href":"/difference", - "html":"

difference source npm

\n
_.difference(array, [values])
\n\n

Creates an array of unique array values not included in the other\nprovided arrays using SameValueZero\nfor equality comparisons.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [values] (...Array)

    The values to exclude.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of filtered values.

\n
\n

示例

\n
_.difference([3, 2, 1], [4, 2]);\n// => [3, 1]\n
\n
\n
" } + "html":"

difference source npm

\n
_.difference(array, [values])
\n\n

创建一个差异化后的数组,不包括使用 SameValueZero 方法提供的数组。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要处理的数组

    \n
  2. \n
  3. [values] (...Array)

    用于对比差异的数组

    \n
  4. \n
\n

返回值 (Array)

\n

返回一个差异化后的新数组

\n
\n

示例

\n
_.difference([3, 2, 1], [4, 2]);\n// => [3, 1]\n
\n
\n
" } ,{ "href":"/differenceBy", - "html":"

differenceBy source npm

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

This method is like _.difference except that it accepts iteratee which\nis invoked for each element of array and values to generate the criterion\nby which uniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [values] (...Array)

    The values to exclude.

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of filtered values.

\n
\n

示例

\n
_.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);\n// => [3.1, 1.3]\n\n// using the `_.property` callback shorthand\n_.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n// => [{ 'x': 2 }]\n
\n
\n
" } + "html":"

differenceBy source npm

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

这个方法类似 _.difference,除了它接受一个 iteratee 调用每一个数组和值。iteratee 会传入一个参数:(value)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要处理的数组

    \n
  2. \n
  3. [values] (...Array)

    用于对比差异的数组

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    这个函数会调用每一个元素

    \n
  6. \n
\n

返回值 (Array)

\n

返回一个差异化后的新数组

\n
\n

示例

\n
_.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);\n// => [3.1, 1.3]\n\n// 使用了 `_.property` 的回调结果\n_.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n// => [{ 'x': 2 }]\n
\n
\n
" } ,{ "href":"/differenceWith", - "html":"

differenceWith source npm

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

This method is like _.difference except that it accepts comparator\nwhich is invoked to compare elements of array to values. The comparator\nis invoked with two arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [values] (...Array)

    The values to exclude.

    \n
  4. \n
  5. [comparator] (Function)

    The comparator invoked per element.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of filtered values.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n\n_.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n// => [{ 'x': 2, 'y': 1 }]\n
\n
\n
" } + "html":"

differenceWith source npm

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

这个方法类似 _.difference,除了它接受一个 comparator 调用每一个数组元素的值。 comparator 会传入2个参数:(arrVal, othVal)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要处理的数组

    \n
  2. \n
  3. [values] (...Array)

    用于对比差异的数组

    \n
  4. \n
  5. [comparator] (Function)

    这个函数会调用每一个元素

    \n
  6. \n
\n

返回值 (Array)

\n

返回一个差异化后的新数组

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n\n_.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n// => [{ 'x': 2, 'y': 1 }]\n
\n
\n
" } ,{ "href":"/drop", - "html":"

drop source npm

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

Creates a slice of array with n elements dropped from the beginning.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [n=1] (number)

    The number of elements to drop.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.drop([1, 2, 3]);\n// => [2, 3]\n\n_.drop([1, 2, 3], 2);\n// => [3]\n\n_.drop([1, 2, 3], 5);\n// => []\n\n_.drop([1, 2, 3], 0);\n// => [1, 2, 3]\n
\n
\n
" } + "html":"

drop source npm

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

裁剪数组中的前 N 个数组,返回剩余的部分。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要处理的数组

    \n
  2. \n
  3. [n=1] (number)

    裁剪的个数

    \n
  4. \n
\n

返回值 (Array)

\n

返回数组的剩余的部分。

\n
\n

示例

\n
_.drop([1, 2, 3]);\n// => [2, 3]\n\n_.drop([1, 2, 3], 2);\n// => [3]\n\n_.drop([1, 2, 3], 5);\n// => []\n\n_.drop([1, 2, 3], 0);\n// => [1, 2, 3]\n
\n
\n
" } ,{ "href":"/dropRight", - "html":"

dropRight source npm

\n
_.dropRight(array, [n=1])
\n\n

Creates a slice of array with n elements dropped from the end.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [n=1] (number)

    The number of elements to drop.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.dropRight([1, 2, 3]);\n// => [1, 2]\n\n_.dropRight([1, 2, 3], 2);\n// => [1]\n\n_.dropRight([1, 2, 3], 5);\n// => []\n\n_.dropRight([1, 2, 3], 0);\n// => [1, 2, 3]\n
\n
\n
" } + "html":"

dropRight source npm

\n
_.dropRight(array, [n=1])
\n\n

从右边开始裁剪数组中的 N 个数组,返回剩余的部分。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要处理的数组

    \n
  2. \n
  3. [n=1] (number)

    裁剪的个数

    \n
  4. \n
\n

返回值 (Array)

\n

返回数组的剩余的部分。

\n
\n

示例

\n
_.dropRight([1, 2, 3]);\n// => [1, 2]\n\n_.dropRight([1, 2, 3], 2);\n// => [1]\n\n_.dropRight([1, 2, 3], 5);\n// => []\n\n_.dropRight([1, 2, 3], 0);\n// => [1, 2, 3]\n
\n
\n
" } ,{ "href":"/dropRightWhile", - "html":"

dropRightWhile source npm

\n
_.dropRightWhile(array, [predicate=_.identity])
\n\n

Creates a slice of array excluding elements dropped from the end.\nElements are dropped until predicate returns falsey. The predicate is\ninvoked with three arguments: (value, index, array).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': true },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': false }\n];\n\nresolve( _.dropRightWhile(users, function(o) { return !o.active; }) );\n// => ['barney']\n\n// using the `_.matches` callback shorthand\nresolve( _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }) );\n// => ['barney', 'fred']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.dropRightWhile(users, ['active', false]) );\n// => ['barney']\n\n// using the `_.property` callback shorthand\nresolve( _.dropRightWhile(users, 'active') );\n// => ['barney', 'fred', 'pebbles']\n
\n
\n
" } + "html":"

dropRightWhile source npm

\n
_.dropRightWhile(array, [predicate=_.identity])
\n\n

从右边开始裁剪数组,起点从 predicate 返回假值开始。predicate 会传入3个参数:(value, index, array)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要处理的数组

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

    \n
  4. \n
\n

返回值 (Array)

\n

返回裁剪后的数组

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': true },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': false }\n];\n\nresolve( _.dropRightWhile(users, function(o) { return !o.active; }) );\n// => ['barney']\n\n// 使用了 `_.matches` 的回调结果\nresolve( _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }) );\n// => ['barney', 'fred']\n\n// 使用了 `_.matchesProperty` 的回调结果\nresolve( _.dropRightWhile(users, ['active', false]) );\n// => ['barney']\n\n// 使用了 `_.property` 的回调结果\nresolve( _.dropRightWhile(users, 'active') );\n// => ['barney', 'fred', 'pebbles']\n
\n
\n
" } ,{ "href":"/dropWhile", - "html":"

dropWhile source npm

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

Creates a slice of array excluding elements dropped from the beginning.\nElements are dropped until predicate returns falsey. The predicate is\ninvoked with three arguments: (value, index, array).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': false },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': true }\n];\n\nresolve( _.dropWhile(users, function(o) { return !o.active; }) );\n// => ['pebbles']\n\n// using the `_.matches` callback shorthand\nresolve( _.dropWhile(users, { 'user': 'barney', 'active': false }) );\n// => ['fred', 'pebbles']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.dropWhile(users, ['active', false]) );\n// => ['pebbles']\n\n// using the `_.property` callback shorthand\nresolve( _.dropWhile(users, 'active') );\n// => ['barney', 'fred', 'pebbles']\n
\n
\n
" } + "html":"

dropWhile source npm

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

裁剪数组,起点从 predicate 返回假值开始。predicate 会传入3个参数:(value, index, array)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    array 需要处理的数组

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': false },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': true }\n];\n\nresolve( _.dropWhile(users, function(o) { return !o.active; }) );\n// => ['pebbles']\n\n// 使用了 `_.matches` 的回调结果\nresolve( _.dropWhile(users, { 'user': 'barney', 'active': false }) );\n// => ['fred', 'pebbles']\n\n// 使用了 `_.matchesProperty` 的回调结果\nresolve( _.dropWhile(users, ['active', false]) );\n// => ['pebbles']\n\n// 使用了 `_.property` 的回调结果\nresolve( _.dropWhile(users, 'active') );\n// => ['barney', 'fred', 'pebbles']\n
\n
\n
" } ,{ "href":"/fill", - "html":"

fill source npm

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

Fills elements of array with value from start up to, but not\nincluding, end.\n
\n
\nNote: This method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to fill.

    \n
  2. \n
  3. value (*)

    The value to fill array with.

    \n
  4. \n
  5. [start=0] (number)

    The start position.

    \n
  6. \n
  7. [end=array.length] (number)

    The end position.

    \n
  8. \n
\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [1, 2, 3];\n\n_.fill(array, 'a');\nconsole.log(array);\n// => ['a', 'a', 'a']\n\n_.fill(Array(3), 2);\n// => [2, 2, 2]\n\n_.fill([4, 6, 8, 10], '*', 1, 3);\n// => [4, '*', '*', 10]\n
\n
\n
" } + "html":"

fill source npm

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

指定 填充数组,从 startend 的位置,但不包括 end 本身的位置。\n
\n
\n注意: 这个方法会改变数组

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要填充的数组

    \n
  2. \n
  3. value (*)

    填充的值

    \n
  4. \n
  5. [start=0] (number)

    开始位置

    \n
  6. \n
  7. [end=array.length] (number)

    结束位置

    \n
  8. \n
\n

返回值 (Array)

\n

返回数组

\n
\n

示例

\n
var array = [1, 2, 3];\n\n_.fill(array, 'a');\nconsole.log(array);\n// => ['a', 'a', 'a']\n\n_.fill(Array(3), 2);\n// => [2, 2, 2]\n\n_.fill([4, 6, 8, 10], '*', 1, 3);\n// => [4, '*', '*', 10]\n
\n
\n
" } ,{ "href":"/findIndex", - "html":"

findIndex source npm

\n
_.findIndex(array, [predicate=_.identity])
\n\n

This method is like _.find except that it returns the index of the first\nelement predicate returns truthy for instead of the element itself.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index of the found element, else -1.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney',  'active': false },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': true }\n];\n\n_.findIndex(users, function(o) { return o.user == 'barney'; });\n// => 0\n\n// using the `_.matches` callback shorthand\n_.findIndex(users, { 'user': 'fred', 'active': false });\n// => 1\n\n// using the `_.matchesProperty` callback shorthand\n_.findIndex(users, ['active', false]);\n// => 0\n\n// using the `_.property` callback shorthand\n_.findIndex(users, 'active');\n// => 2\n
\n
\n
" } + "html":"

findIndex source npm

\n
_.findIndex(array, [predicate=_.identity])
\n\n

这个方法类似 _.find。除了它返回最先通过 predicate 判断为真值的元素的 index ,而不是元素本身。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要搜索的数组

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

    \n
  4. \n
\n

返回值 (number)

\n

返回符合元素的 index,否则返回 -1

\n
\n

示例

\n
var users = [\n  { 'user': 'barney',  'active': false },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': true }\n];\n\n_.findIndex(users, function(o) { return o.user == 'barney'; });\n// => 0\n\n// 使用了 `_.matches` 的回调结果\n_.findIndex(users, { 'user': 'fred', 'active': false });\n// => 1\n\n// 使用了 `_.matchesProperty` 的回调结果\n_.findIndex(users, ['active', false]);\n// => 0\n\n// 使用了 `_.property` 的回调结果\n_.findIndex(users, 'active');\n// => 2\n
\n
\n
" } ,{ "href":"/findLastIndex", - "html":"

findLastIndex source npm

\n
_.findLastIndex(array, [predicate=_.identity])
\n\n

This method is like _.findIndex except that it iterates over elements\nof collection from right to left.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index of the found element, else -1.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney',  'active': true },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': false }\n];\n\n_.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n// => 2\n\n// using the `_.matches` callback shorthand\n_.findLastIndex(users, { 'user': 'barney', 'active': true });\n// => 0\n\n// using the `_.matchesProperty` callback shorthand\n_.findLastIndex(users, ['active', false]);\n// => 2\n\n// using the `_.property` callback shorthand\n_.findLastIndex(users, 'active');\n// => 0\n
\n
\n
" } + "html":"

findLastIndex source npm

\n
_.findLastIndex(array, [predicate=_.identity])
\n\n

这个方式类似 _.findIndex , 不过它是从右到左迭代的。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    需要搜索的数组

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

    \n
  4. \n
\n

返回值 (number)

\n

返回符合元素的 index,否则返回 -1

\n
\n

示例

\n
var users = [\n  { 'user': 'barney',  'active': true },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': false }\n];\n\n_.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n// => 2\n\n// 使用了 `_.matches` 的回调结果\n_.findLastIndex(users, { 'user': 'barney', 'active': true });\n// => 0\n\n// 使用了 `_.matchesProperty` 的回调结果\n_.findLastIndex(users, ['active', false]);\n// => 2\n\n// 使用了 `_.property` 的回调结果\n_.findLastIndex(users, 'active');\n// => 0\n
\n
\n
" } ,{ "href":"/flatMap", - "html":"

flatMap source npm

\n
_.flatMap(array, [iteratee=_.identity])
\n\n

Creates an array of flattened values by running each element in array\nthrough iteratee and concating its result to the other mapped values.\nThe iteratee is invoked with three arguments: (value, index|key, array).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array.

\n
\n

示例

\n
function duplicate(n) {\n  return [n, n];\n}\n\n_.flatMap([1, 2], duplicate);\n// => [1, 1, 2, 2]\n
\n
\n
" } + "html":"

flatMap source npm

\n
_.flatMap(array, [iteratee=_.identity])
\n\n

创建一个扁平化的数组,每一个值会传入 iteratee 处理,处理结果会与值合并。\niteratee 会传入3个参数:(value, index|key, array)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    遍历用的数组

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    这个函数会在每一次迭代调用

    \n
  4. \n
\n

返回值 (Array)

\n

返回新数组

\n
\n

示例

\n
function duplicate(n) {\n  return [n, n];\n}\n\n_.flatMap([1, 2], duplicate);\n// => [1, 1, 2, 2]\n
\n
\n
" } ,{ "href":"/flatten", - "html":"

flatten source npm

\n
_.flatten(array)
\n\n

Flattens array a single level.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to flatten.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new flattened array.

\n
\n

示例

\n
_.flatten([1, [2, 3, [4]]]);\n// => [1, 2, 3, [4]]\n
\n
\n
" } + "html":"

flatten source npm

\n
_.flatten(array)
\n\n

Flattens array a single level.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to flatten.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new flattened array.

\n
\n

示例

\n
_.flatten([1, [2, 3, [4]]]);\n// => [1, 2, 3, [4]]\n
\n
\n
" } ,{ "href":"/flattenDeep", - "html":"

flattenDeep source npm

\n
_.flattenDeep(array)
\n\n

This method is like _.flatten except that it recursively flattens array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to recursively flatten.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new flattened array.

\n
\n

示例

\n
_.flattenDeep([1, [2, 3, [4]]]);\n// => [1, 2, 3, 4]\n
\n
\n
" } + "html":"

flattenDeep source npm

\n
_.flattenDeep(array)
\n\n

This method is like _.flatten except that it recursively flattens array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to recursively flatten.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new flattened array.

\n
\n

示例

\n
_.flattenDeep([1, [2, 3, [4]]]);\n// => [1, 2, 3, 4]\n
\n
\n
" } ,{ "href":"/fromPairs", - "html":"

fromPairs source npm

\n
_.fromPairs(pairs)
\n\n

The inverse of _.toPairs; this method returns an object composed\nfrom key-value pairs.

\n
\n\n

参数

\n
    \n
  1. pairs (Array)

    The key-value pairs.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
_.fromPairs([['fred', 30], ['barney', 40]]);\n// => { 'fred': 30, 'barney': 40 }\n
\n
\n
" } + "html":"

fromPairs source npm

\n
_.fromPairs(pairs)
\n\n

The inverse of _.toPairs; this method returns an object composed\nfrom key-value pairs.

\n
\n\n

参数

\n
    \n
  1. pairs (Array)

    The key-value pairs.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
_.fromPairs([['fred', 30], ['barney', 40]]);\n// => { 'fred': 30, 'barney': 40 }\n
\n
\n
" } ,{ "href":"/head", - "html":"

head first source npm

\n
_.head(array)
\n\n

Gets the first element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the first element of array.

\n
\n

示例

\n
_.head([1, 2, 3]);\n// => 1\n\n_.head([]);\n// => undefined\n
\n
\n
" } + "html":"

head first source npm

\n
_.head(array)
\n\n

Gets the first element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the first element of array.

\n
\n

示例

\n
_.head([1, 2, 3]);\n// => 1\n\n_.head([]);\n// => undefined\n
\n
\n
" } ,{ "href":"/indexOf", - "html":"

indexOf source npm

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

Gets the index at which the first occurrence of value is found in array\nusing SameValueZero\nfor equality comparisons. If fromIndex is negative, it's used as the offset\nfrom the end of array. If array is sorted providing true for fromIndex\nperforms a faster binary search.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
  5. [fromIndex=0] (number)

    The index to search from.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.indexOf([1, 2, 1, 2], 2);\n// => 1\n\n// using `fromIndex`\n_.indexOf([1, 2, 1, 2], 2, 2);\n// => 3\n
\n
\n
" } + "html":"

indexOf source npm

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

Gets the index at which the first occurrence of value is found in array\nusing SameValueZero\nfor equality comparisons. If fromIndex is negative, it's used as the offset\nfrom the end of array. If array is sorted providing true for fromIndex\nperforms a faster binary search.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
  5. [fromIndex=0] (number)

    The index to search from.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.indexOf([1, 2, 1, 2], 2);\n// => 1\n\n// using `fromIndex`\n_.indexOf([1, 2, 1, 2], 2, 2);\n// => 3\n
\n
\n
" } ,{ "href":"/initial", - "html":"

initial source npm

\n
_.initial(array)
\n\n

Gets all but the last element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.initial([1, 2, 3]);\n// => [1, 2]\n
\n
\n
" } + "html":"

initial source npm

\n
_.initial(array)
\n\n

Gets all but the last element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.initial([1, 2, 3]);\n// => [1, 2]\n
\n
\n
" } ,{ "href":"/intersection", - "html":"

intersection source npm

\n
_.intersection([arrays])
\n\n

Creates an array of unique values that are included in all of the provided\narrays using SameValueZero\nfor equality comparisons.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of shared values.

\n
\n

示例

\n
_.intersection([2, 1], [4, 2], [1, 2]);\n// => [2]\n
\n
\n
" } + "html":"

intersection source npm

\n
_.intersection([arrays])
\n\n

Creates an array of unique values that are included in all of the provided\narrays using SameValueZero\nfor equality comparisons.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of shared values.

\n
\n

示例

\n
_.intersection([2, 1], [4, 2], [1, 2]);\n// => [2]\n
\n
\n
" } ,{ "href":"/intersectionBy", - "html":"

intersectionBy source npm

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

This method is like _.intersection except that it accepts iteratee\nwhich is invoked for each element of each arrays to generate the criterion\nby which uniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of shared values.

\n
\n

示例

\n
_.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);\n// => [2.1]\n\n// using the `_.property` callback shorthand\n_.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 1 }]\n
\n
\n
" } + "html":"

intersectionBy source npm

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

This method is like _.intersection except that it accepts iteratee\nwhich is invoked for each element of each arrays to generate the criterion\nby which uniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of shared values.

\n
\n

示例

\n
_.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);\n// => [2.1]\n\n// using the `_.property` callback shorthand\n_.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 1 }]\n
\n
\n
" } ,{ "href":"/intersectionWith", - "html":"

intersectionWith source npm

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

This method is like _.intersection except that it accepts comparator\nwhich is invoked to compare elements of arrays. The comparator is invoked\nwith two arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of shared values.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\nvar others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n\n_.intersectionWith(objects, others, _.isEqual);\n// => [{ 'x': 1, 'y': 2 }]\n
\n
\n
" } + "html":"

intersectionWith source npm

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

This method is like _.intersection except that it accepts comparator\nwhich is invoked to compare elements of arrays. The comparator is invoked\nwith two arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of shared values.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\nvar others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n\n_.intersectionWith(objects, others, _.isEqual);\n// => [{ 'x': 1, 'y': 2 }]\n
\n
\n
" } ,{ "href":"/join", - "html":"

join source npm

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

Converts all elements in array into a string separated by separator.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to convert.

    \n
  2. \n
  3. [separator=','] (string)

    The element separator.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the joined string.

\n
\n

示例

\n
_.join(['a', 'b', 'c'], '~');\n// => 'a~b~c'\n
\n
\n
" } + "html":"

join source npm

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

Converts all elements in array into a string separated by separator.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to convert.

    \n
  2. \n
  3. [separator=','] (string)

    The element separator.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the joined string.

\n
\n

示例

\n
_.join(['a', 'b', 'c'], '~');\n// => 'a~b~c'\n
\n
\n
" } ,{ "href":"/last", - "html":"

last source npm

\n
_.last(array)
\n\n

Gets the last element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the last element of array.

\n
\n

示例

\n
_.last([1, 2, 3]);\n// => 3\n
\n
\n
" } + "html":"

last source npm

\n
_.last(array)
\n\n

Gets the last element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the last element of array.

\n
\n

示例

\n
_.last([1, 2, 3]);\n// => 3\n
\n
\n
" } ,{ "href":"/lastIndexOf", - "html":"

lastIndexOf source npm

\n
_.lastIndexOf(array, value, [fromIndex=array.length-1])
\n\n

This method is like _.indexOf except that it iterates over elements of\narray from right to left.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
  5. [fromIndex=array.length-1] (number)

    The index to search from.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.lastIndexOf([1, 2, 1, 2], 2);\n// => 3\n\n// using `fromIndex`\n_.lastIndexOf([1, 2, 1, 2], 2, 2);\n// => 1\n
\n
\n
" } + "html":"

lastIndexOf source npm

\n
_.lastIndexOf(array, value, [fromIndex=array.length-1])
\n\n

This method is like _.indexOf except that it iterates over elements of\narray from right to left.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
  5. [fromIndex=array.length-1] (number)

    The index to search from.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.lastIndexOf([1, 2, 1, 2], 2);\n// => 3\n\n// using `fromIndex`\n_.lastIndexOf([1, 2, 1, 2], 2, 2);\n// => 1\n
\n
\n
" } ,{ "href":"/prototype-reverse", - "html":"

prototype.reverse source npm

\n
_.prototype.reverse()
\n\n

Reverses array so that the first element becomes the last, the second\nelement becomes the second to last, and so on.\n
\n
\nNote: This method mutates array and is based on\nArray#reverse.

\n
\n\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [1, 2, 3];\n\n_.reverse(array);\n// => [3, 2, 1]\n\nconsole.log(array);\n// => [3, 2, 1]\n
\n
\n
" } + "html":"

prototype.reverse source npm

\n
_.prototype.reverse()
\n\n

Reverses array so that the first element becomes the last, the second\nelement becomes the second to last, and so on.\n
\n
\nNote: This method mutates array and is based on\nArray#reverse.

\n
\n\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [1, 2, 3];\n\n_.reverse(array);\n// => [3, 2, 1]\n\nconsole.log(array);\n// => [3, 2, 1]\n
\n
\n
" } ,{ "href":"/pull", - "html":"

pull source npm

\n
_.pull(array, [values])
\n\n

Removes all provided values from array using\nSameValueZero\nfor equality comparisons.\n
\n
\nNote: Unlike _.without, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. [values] (...*)

    The values to remove.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [1, 2, 3, 1, 2, 3];\n\n_.pull(array, 2, 3);\nconsole.log(array);\n// => [1, 1]\n
\n
\n
" } + "html":"

pull source npm

\n
_.pull(array, [values])
\n\n

Removes all provided values from array using\nSameValueZero\nfor equality comparisons.\n
\n
\nNote: Unlike _.without, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. [values] (...*)

    The values to remove.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [1, 2, 3, 1, 2, 3];\n\n_.pull(array, 2, 3);\nconsole.log(array);\n// => [1, 1]\n
\n
\n
" } ,{ "href":"/pullAll", - "html":"

pullAll source npm

\n
_.pullAll(array, values)
\n\n

This method is like _.pull except that it accepts an array of values to remove.\n
\n
\nNote: Unlike _.difference, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. values (Array)

    The values to remove.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [1, 2, 3, 1, 2, 3];\n\n_.pull(array, [2, 3]);\nconsole.log(array);\n// => [1, 1]\n
\n
\n
" } + "html":"

pullAll source npm

\n
_.pullAll(array, values)
\n\n

This method is like _.pull except that it accepts an array of values to remove.\n
\n
\nNote: Unlike _.difference, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. values (Array)

    The values to remove.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [1, 2, 3, 1, 2, 3];\n\n_.pull(array, [2, 3]);\nconsole.log(array);\n// => [1, 1]\n
\n
\n
" } ,{ "href":"/pullAllBy", - "html":"

pullAllBy source npm

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

This method is like _.pullAll except that it accepts iteratee which is\ninvoked for each element of array and values to to generate the criterion\nby which uniqueness is computed. The iteratee is invoked with one argument: (value).\n
\n
\nNote: Unlike _.differenceBy, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. values (Array)

    The values to remove.

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n\n_.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\nconsole.log(array);\n// => [{ 'x': 2 }]\n
\n
\n
" } + "html":"

pullAllBy source npm

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

This method is like _.pullAll except that it accepts iteratee which is\ninvoked for each element of array and values to to generate the criterion\nby which uniqueness is computed. The iteratee is invoked with one argument: (value).\n
\n
\nNote: Unlike _.differenceBy, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. values (Array)

    The values to remove.

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns array.

\n
\n

示例

\n
var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n\n_.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\nconsole.log(array);\n// => [{ 'x': 2 }]\n
\n
\n
" } ,{ "href":"/pullAt", - "html":"

pullAt source npm

\n
_.pullAt(array, [indexes])
\n\n

Removes elements from array corresponding to indexes and returns an\narray of removed elements.\n
\n
\nNote: Unlike _.at, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. [indexes] (...(number|number[])

    The indexes of elements to remove, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of removed elements.

\n
\n

示例

\n
var array = [5, 10, 15, 20];\nvar evens = _.pullAt(array, 1, 3);\n\nconsole.log(array);\n// => [5, 15]\n\nconsole.log(evens);\n// => [10, 20]\n
\n
\n
" } + "html":"

pullAt source npm

\n
_.pullAt(array, [indexes])
\n\n

Removes elements from array corresponding to indexes and returns an\narray of removed elements.\n
\n
\nNote: Unlike _.at, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. [indexes] (...(number|number[])

    The indexes of elements to remove, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of removed elements.

\n
\n

示例

\n
var array = [5, 10, 15, 20];\nvar evens = _.pullAt(array, 1, 3);\n\nconsole.log(array);\n// => [5, 15]\n\nconsole.log(evens);\n// => [10, 20]\n
\n
\n
" } ,{ "href":"/remove", - "html":"

remove source npm

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

Removes all elements from array that predicate returns truthy for\nand returns an array of the removed elements. The predicate is invoked with\nthree arguments: (value, index, array).\n
\n
\nNote: Unlike _.filter, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of removed elements.

\n
\n

示例

\n
var array = [1, 2, 3, 4];\nvar evens = _.remove(array, function(n) {\n  return n % 2 == 0;\n});\n\nconsole.log(array);\n// => [1, 3]\n\nconsole.log(evens);\n// => [2, 4]\n
\n
\n
" } + "html":"

remove source npm

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

Removes all elements from array that predicate returns truthy for\nand returns an array of the removed elements. The predicate is invoked with\nthree arguments: (value, index, array).\n
\n
\nNote: Unlike _.filter, this method mutates array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to modify.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of removed elements.

\n
\n

示例

\n
var array = [1, 2, 3, 4];\nvar evens = _.remove(array, function(n) {\n  return n % 2 == 0;\n});\n\nconsole.log(array);\n// => [1, 3]\n\nconsole.log(evens);\n// => [2, 4]\n
\n
\n
" } ,{ "href":"/slice", - "html":"

slice source npm

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

Creates a slice of array from start up to, but not including, end.\n
\n
\nNote: This method is used instead of Array#slice\nto ensure dense arrays are returned.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to slice.

    \n
  2. \n
  3. [start=0] (number)

    The start position.

    \n
  4. \n
  5. [end=array.length] (number)

    The end position.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n
" } + "html":"

slice source npm

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

Creates a slice of array from start up to, but not including, end.\n
\n
\nNote: This method is used instead of Array#slice\nto ensure dense arrays are returned.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to slice.

    \n
  2. \n
  3. [start=0] (number)

    The start position.

    \n
  4. \n
  5. [end=array.length] (number)

    The end position.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n
" } ,{ "href":"/sortedIndex", - "html":"

sortedIndex source npm

\n
_.sortedIndex(array, value)
\n\n

Uses a binary search to determine the lowest index at which value should\nbe inserted into array in order to maintain its sort order.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
_.sortedIndex([30, 50], 40);\n// => 1\n\n_.sortedIndex([4, 5], 4);\n// => 0\n
\n
\n
" } + "html":"

sortedIndex source npm

\n
_.sortedIndex(array, value)
\n\n

Uses a binary search to determine the lowest index at which value should\nbe inserted into array in order to maintain its sort order.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
_.sortedIndex([30, 50], 40);\n// => 1\n\n_.sortedIndex([4, 5], 4);\n// => 0\n
\n
\n
" } ,{ "href":"/sortedIndexBy", - "html":"

sortedIndexBy source npm

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

This method is like _.sortedIndex except that it accepts iteratee\nwhich is invoked for value and each element of array to compute their\nsort ranking. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };\n\n_.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));\n// => 1\n\n// using the `_.property` callback shorthand\n_.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');\n// => 0\n
\n
\n
" } + "html":"

sortedIndexBy source npm

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

This method is like _.sortedIndex except that it accepts iteratee\nwhich is invoked for value and each element of array to compute their\nsort ranking. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };\n\n_.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));\n// => 1\n\n// using the `_.property` callback shorthand\n_.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');\n// => 0\n
\n
\n
" } ,{ "href":"/sortedIndexOf", - "html":"

sortedIndexOf source npm

\n
_.sortedIndexOf(array, value)
\n\n

This method is like _.indexOf except that it performs a binary\nsearch on a sorted array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.sortedIndexOf([1, 1, 2, 2], 2);\n// => 2\n
\n
\n
" } + "html":"

sortedIndexOf source npm

\n
_.sortedIndexOf(array, value)
\n\n

This method is like _.indexOf except that it performs a binary\nsearch on a sorted array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.sortedIndexOf([1, 1, 2, 2], 2);\n// => 2\n
\n
\n
" } ,{ "href":"/sortedLastIndex", - "html":"

sortedLastIndex source npm

\n
_.sortedLastIndex(array, value)
\n\n

This method is like _.sortedIndex except that it returns the highest\nindex at which value should be inserted into array in order to\nmaintain its sort order.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
_.sortedLastIndex([4, 5], 4);\n// => 1\n
\n
\n
" } + "html":"

sortedLastIndex source npm

\n
_.sortedLastIndex(array, value)
\n\n

This method is like _.sortedIndex except that it returns the highest\nindex at which value should be inserted into array in order to\nmaintain its sort order.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
_.sortedLastIndex([4, 5], 4);\n// => 1\n
\n
\n
" } ,{ "href":"/sortedLastIndexBy", - "html":"

sortedLastIndexBy source npm

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

This method is like _.sortedLastIndex except that it accepts iteratee\nwhich is invoked for value and each element of array to compute their\nsort ranking. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
// using the `_.property` callback shorthand\n_.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');\n// => 1\n
\n
\n
" } + "html":"

sortedLastIndexBy source npm

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

This method is like _.sortedLastIndex except that it accepts iteratee\nwhich is invoked for value and each element of array to compute their\nsort ranking. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The sorted array to inspect.

    \n
  2. \n
  3. value (*)

    The value to evaluate.

    \n
  4. \n
  5. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the index at which value should be inserted into array.

\n
\n

示例

\n
// using the `_.property` callback shorthand\n_.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');\n// => 1\n
\n
\n
" } ,{ "href":"/sortedLastIndexOf", - "html":"

sortedLastIndexOf source npm

\n
_.sortedLastIndexOf(array, value)
\n\n

This method is like _.lastIndexOf except that it performs a binary\nsearch on a sorted array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.sortedLastIndexOf([1, 1, 2, 2], 2);\n// => 3\n
\n
\n
" } + "html":"

sortedLastIndexOf source npm

\n
_.sortedLastIndexOf(array, value)
\n\n

This method is like _.lastIndexOf except that it performs a binary\nsearch on a sorted array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the index of the matched value, else -1.

\n
\n

示例

\n
_.sortedLastIndexOf([1, 1, 2, 2], 2);\n// => 3\n
\n
\n
" } ,{ "href":"/sortedUniq", - "html":"

sortedUniq source npm

\n
_.sortedUniq(array)
\n\n

This method is like _.uniq except that it's designed and optimized\nfor sorted arrays.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.sortedUniq([1, 1, 2]);\n// => [1, 2]\n
\n
\n
" } + "html":"

sortedUniq source npm

\n
_.sortedUniq(array)
\n\n

This method is like _.uniq except that it's designed and optimized\nfor sorted arrays.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.sortedUniq([1, 1, 2]);\n// => [1, 2]\n
\n
\n
" } ,{ "href":"/sortedUniqBy", - "html":"

sortedUniqBy source npm

\n
_.sortedUniqBy(array, [iteratee])
\n\n

This method is like _.uniqBy except that it's designed and optimized\nfor sorted arrays.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [iteratee] (Function)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n// => [1.1, 2.2]\n
\n
\n
" } + "html":"

sortedUniqBy source npm

\n
_.sortedUniqBy(array, [iteratee])
\n\n

This method is like _.uniqBy except that it's designed and optimized\nfor sorted arrays.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [iteratee] (Function)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n// => [1.1, 2.2]\n
\n
\n
" } ,{ "href":"/tail", - "html":"

tail source npm

\n
_.tail(array)
\n\n

Gets all but the first element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.tail([1, 2, 3]);\n// => [2, 3]\n
\n
\n
" } + "html":"

tail source npm

\n
_.tail(array)
\n\n

Gets all but the first element of array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.tail([1, 2, 3]);\n// => [2, 3]\n
\n
\n
" } ,{ "href":"/take", - "html":"

take source npm

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

Creates a slice of array with n elements taken from the beginning.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [n=1] (number)

    The number of elements to take.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.take([1, 2, 3]);\n// => [1]\n\n_.take([1, 2, 3], 2);\n// => [1, 2]\n\n_.take([1, 2, 3], 5);\n// => [1, 2, 3]\n\n_.take([1, 2, 3], 0);\n// => []\n
\n
\n
" } + "html":"

take source npm

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

Creates a slice of array with n elements taken from the beginning.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [n=1] (number)

    The number of elements to take.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.take([1, 2, 3]);\n// => [1]\n\n_.take([1, 2, 3], 2);\n// => [1, 2]\n\n_.take([1, 2, 3], 5);\n// => [1, 2, 3]\n\n_.take([1, 2, 3], 0);\n// => []\n
\n
\n
" } ,{ "href":"/takeRight", - "html":"

takeRight source npm

\n
_.takeRight(array, [n=1])
\n\n

Creates a slice of array with n elements taken from the end.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [n=1] (number)

    The number of elements to take.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.takeRight([1, 2, 3]);\n// => [3]\n\n_.takeRight([1, 2, 3], 2);\n// => [2, 3]\n\n_.takeRight([1, 2, 3], 5);\n// => [1, 2, 3]\n\n_.takeRight([1, 2, 3], 0);\n// => []\n
\n
\n
" } + "html":"

takeRight source npm

\n
_.takeRight(array, [n=1])
\n\n

Creates a slice of array with n elements taken from the end.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [n=1] (number)

    The number of elements to take.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
_.takeRight([1, 2, 3]);\n// => [3]\n\n_.takeRight([1, 2, 3], 2);\n// => [2, 3]\n\n_.takeRight([1, 2, 3], 5);\n// => [1, 2, 3]\n\n_.takeRight([1, 2, 3], 0);\n// => []\n
\n
\n
" } ,{ "href":"/takeRightWhile", - "html":"

takeRightWhile source npm

\n
_.takeRightWhile(array, [predicate=_.identity])
\n\n

Creates a slice of array with elements taken from the end. Elements are\ntaken until predicate returns falsey. The predicate is invoked with three\narguments: (value, index, array).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': true },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': false }\n];\n\nresolve( _.takeRightWhile(users, function(o) { return !o.active; }) );\n// => ['fred', 'pebbles']\n\n// using the `_.matches` callback shorthand\nresolve( _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }) );\n// => ['pebbles']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.takeRightWhile(users, ['active', false]) );\n// => ['fred', 'pebbles']\n\n// using the `_.property` callback shorthand\nresolve( _.takeRightWhile(users, 'active') );\n// => []\n
\n
\n
" } + "html":"

takeRightWhile source npm

\n
_.takeRightWhile(array, [predicate=_.identity])
\n\n

Creates a slice of array with elements taken from the end. Elements are\ntaken until predicate returns falsey. The predicate is invoked with three\narguments: (value, index, array).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': true },\n  { 'user': 'fred',    'active': false },\n  { 'user': 'pebbles', 'active': false }\n];\n\nresolve( _.takeRightWhile(users, function(o) { return !o.active; }) );\n// => ['fred', 'pebbles']\n\n// using the `_.matches` callback shorthand\nresolve( _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }) );\n// => ['pebbles']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.takeRightWhile(users, ['active', false]) );\n// => ['fred', 'pebbles']\n\n// using the `_.property` callback shorthand\nresolve( _.takeRightWhile(users, 'active') );\n// => []\n
\n
\n
" } ,{ "href":"/takeWhile", - "html":"

takeWhile source npm

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

Creates a slice of array with elements taken from the beginning. Elements\nare taken until predicate returns falsey. The predicate is invoked with\nthree arguments: (value, index, array).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': false },\n  { 'user': 'fred',    'active': false},\n  { 'user': 'pebbles', 'active': true }\n];\n\nresolve( _.takeWhile(users, function(o) { return !o.active; }) );\n// => ['barney', 'fred']\n\n// using the `_.matches` callback shorthand\nresolve( _.takeWhile(users, { 'user': 'barney', 'active': false }) );\n// => ['barney']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.takeWhile(users, ['active', false]) );\n// => ['barney', 'fred']\n\n// using the `_.property` callback shorthand\nresolve( _.takeWhile(users, 'active') );\n// => []\n
\n
\n
" } + "html":"

takeWhile source npm

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

Creates a slice of array with elements taken from the beginning. Elements\nare taken until predicate returns falsey. The predicate is invoked with\nthree arguments: (value, index, array).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to query.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the slice of array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'active': false },\n  { 'user': 'fred',    'active': false},\n  { 'user': 'pebbles', 'active': true }\n];\n\nresolve( _.takeWhile(users, function(o) { return !o.active; }) );\n// => ['barney', 'fred']\n\n// using the `_.matches` callback shorthand\nresolve( _.takeWhile(users, { 'user': 'barney', 'active': false }) );\n// => ['barney']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.takeWhile(users, ['active', false]) );\n// => ['barney', 'fred']\n\n// using the `_.property` callback shorthand\nresolve( _.takeWhile(users, 'active') );\n// => []\n
\n
\n
" } ,{ "href":"/union", - "html":"

union source npm

\n
_.union([arrays])
\n\n

Creates an array of unique values, in order, from all of the provided arrays\nusing SameValueZero\nfor equality comparisons.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of combined values.

\n
\n

示例

\n
_.union([2, 1], [4, 2], [1, 2]);\n// => [2, 1, 4]\n
\n
\n
" } + "html":"

union source npm

\n
_.union([arrays])
\n\n

Creates an array of unique values, in order, from all of the provided arrays\nusing SameValueZero\nfor equality comparisons.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of combined values.

\n
\n

示例

\n
_.union([2, 1], [4, 2], [1, 2]);\n// => [2, 1, 4]\n
\n
\n
" } ,{ "href":"/unionBy", - "html":"

unionBy source npm

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

This method is like _.union except that it accepts iteratee which is\ninvoked for each element of each arrays to generate the criterion by which\nuniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of combined values.

\n
\n

示例

\n
_.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);\n// => [2.1, 1.2, 4.3]\n\n// using the `_.property` callback shorthand\n_.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 1 }, { 'x': 2 }]\n
\n
\n
" } + "html":"

unionBy source npm

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

This method is like _.union except that it accepts iteratee which is\ninvoked for each element of each arrays to generate the criterion by which\nuniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of combined values.

\n
\n

示例

\n
_.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);\n// => [2.1, 1.2, 4.3]\n\n// using the `_.property` callback shorthand\n_.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 1 }, { 'x': 2 }]\n
\n
\n
" } ,{ "href":"/unionWith", - "html":"

unionWith source npm

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

This method is like _.union except that it accepts comparator which\nis invoked to compare elements of arrays. The comparator is invoked\nwith two arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of combined values.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\nvar others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n\n_.unionWith(objects, others, _.isEqual);\n// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n
\n
\n
" } + "html":"

unionWith source npm

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

This method is like _.union except that it accepts comparator which\nis invoked to compare elements of arrays. The comparator is invoked\nwith two arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of combined values.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\nvar others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n\n_.unionWith(objects, others, _.isEqual);\n// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n
\n
\n
" } ,{ "href":"/uniq", - "html":"

uniq source npm

\n
_.uniq(array)
\n\n

Creates a duplicate-free version of an array, using\nSameValueZero\nfor equality comparisons, in which only the first occurrence of each element\nis kept.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.uniq([2, 1, 2]);\n// => [2, 1]\n
\n
\n
" } + "html":"

uniq source npm

\n
_.uniq(array)
\n\n

Creates a duplicate-free version of an array, using\nSameValueZero\nfor equality comparisons, in which only the first occurrence of each element\nis kept.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.uniq([2, 1, 2]);\n// => [2, 1]\n
\n
\n
" } ,{ "href":"/uniqBy", - "html":"

uniqBy source npm

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

This method is like _.uniq except that it accepts iteratee which is\ninvoked for each element in array to generate the criterion by which\nuniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.uniqBy([2.1, 1.2, 2.3], Math.floor);\n// => [2.1, 1.2]\n\n// using the `_.property` callback shorthand\n_.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 1 }, { 'x': 2 }]\n
\n
\n
" } + "html":"

uniqBy source npm

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

This method is like _.uniq except that it accepts iteratee which is\ninvoked for each element in array to generate the criterion by which\nuniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
_.uniqBy([2.1, 1.2, 2.3], Math.floor);\n// => [2.1, 1.2]\n\n// using the `_.property` callback shorthand\n_.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 1 }, { 'x': 2 }]\n
\n
\n
" } ,{ "href":"/uniqWith", - "html":"

uniqWith source npm

\n
_.uniqWith(array, [comparator])
\n\n

This method is like _.uniq except that it accepts comparator which\nis invoked to compare elements of array. The comparator is invoked with\ntwo arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];\n\n_.uniqWith(objects, _.isEqual);\n// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n
\n
\n
" } + "html":"

uniqWith source npm

\n
_.uniqWith(array, [comparator])
\n\n

This method is like _.uniq except that it accepts comparator which\nis invoked to compare elements of array. The comparator is invoked with\ntwo arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new duplicate free array.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];\n\n_.uniqWith(objects, _.isEqual);\n// => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n
\n
\n
" } ,{ "href":"/unzip", - "html":"

unzip source npm

\n
_.unzip(array)
\n\n

This method is like _.zip except that it accepts an array of grouped\nelements and creates an array regrouping the elements to their pre-zip\nconfiguration.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array of grouped elements to process.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of regrouped elements.

\n
\n

示例

\n
var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);\n// => [['fred', 30, true], ['barney', 40, false]]\n\n_.unzip(zipped);\n// => [['fred', 'barney'], [30, 40], [true, false]]\n
\n
\n
" } + "html":"

unzip source npm

\n
_.unzip(array)
\n\n

This method is like _.zip except that it accepts an array of grouped\nelements and creates an array regrouping the elements to their pre-zip\nconfiguration.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array of grouped elements to process.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of regrouped elements.

\n
\n

示例

\n
var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);\n// => [['fred', 30, true], ['barney', 40, false]]\n\n_.unzip(zipped);\n// => [['fred', 'barney'], [30, 40], [true, false]]\n
\n
\n
" } ,{ "href":"/unzipWith", - "html":"

unzipWith source npm

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

This method is like _.unzip except that it accepts iteratee to specify\nhow regrouped values should be combined. The iteratee is invoked with four\narguments: (accumulator, value, index, group). The first element of each\ngroup is used as the initial accumulator value.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array of grouped elements to process.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function to combine regrouped values.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of regrouped elements.

\n
\n

示例

\n
var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n// => [[1, 10, 100], [2, 20, 200]]\n\n_.unzipWith(zipped, _.add);\n// => [3, 30, 300]\n
\n
\n
" } + "html":"

unzipWith source npm

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

This method is like _.unzip except that it accepts iteratee to specify\nhow regrouped values should be combined. The iteratee is invoked with four\narguments: (accumulator, value, index, group). The first element of each\ngroup is used as the initial accumulator value.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array of grouped elements to process.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function to combine regrouped values.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of regrouped elements.

\n
\n

示例

\n
var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n// => [[1, 10, 100], [2, 20, 200]]\n\n_.unzipWith(zipped, _.add);\n// => [3, 30, 300]\n
\n
\n
" } ,{ "href":"/without", - "html":"

without source npm

\n
_.without(array, [values])
\n\n

Creates an array excluding all provided values using\nSameValueZero\nfor equality comparisons.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to filter.

    \n
  2. \n
  3. [values] (...*)

    The values to exclude.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of filtered values.

\n
\n

示例

\n
_.without([1, 2, 1, 3], 1, 2);\n// => [3]\n
\n
\n
" } + "html":"

without source npm

\n
_.without(array, [values])
\n\n

Creates an array excluding all provided values using\nSameValueZero\nfor equality comparisons.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to filter.

    \n
  2. \n
  3. [values] (...*)

    The values to exclude.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of filtered values.

\n
\n

示例

\n
_.without([1, 2, 1, 3], 1, 2);\n// => [3]\n
\n
\n
" } ,{ "href":"/xor", - "html":"

xor source npm

\n
_.xor([arrays])
\n\n

Creates an array of unique values that is the symmetric difference\nof the provided arrays.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of values.

\n
\n

示例

\n
_.xor([2, 1], [4, 2]);\n// => [1, 4]\n
\n
\n
" } + "html":"

xor source npm

\n
_.xor([arrays])
\n\n

Creates an array of unique values that is the symmetric difference\nof the provided arrays.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of values.

\n
\n

示例

\n
_.xor([2, 1], [4, 2]);\n// => [1, 4]\n
\n
\n
" } ,{ "href":"/xorBy", - "html":"

xorBy source npm

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

This method is like _.xor except that it accepts iteratee which is\ninvoked for each element of each arrays to generate the criterion by which\nuniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of values.

\n
\n

示例

\n
_.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);\n// => [1.2, 4.3]\n\n// using the `_.property` callback shorthand\n_.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 2 }]\n
\n
\n
" } + "html":"

xorBy source npm

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

This method is like _.xor except that it accepts iteratee which is\ninvoked for each element of each arrays to generate the criterion by which\nuniqueness is computed. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of values.

\n
\n

示例

\n
_.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);\n// => [1.2, 4.3]\n\n// using the `_.property` callback shorthand\n_.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n// => [{ 'x': 2 }]\n
\n
\n
" } ,{ "href":"/xorWith", - "html":"

xorWith source npm

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

This method is like _.xor except that it accepts comparator which is\ninvoked to compare elements of arrays. The comparator is invoked with\ntwo arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of values.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\nvar others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n\n_.xorWith(objects, others, _.isEqual);\n// => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n
\n
\n
" } + "html":"

xorWith source npm

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

This method is like _.xor except that it accepts comparator which is\ninvoked to compare elements of arrays. The comparator is invoked with\ntwo arguments: (arrVal, othVal).

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to inspect.

    \n
  2. \n
  3. [comparator] (Function)

    The comparator invoked per element.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of values.

\n
\n

示例

\n
var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\nvar others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n\n_.xorWith(objects, others, _.isEqual);\n// => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n
\n
\n
" } ,{ "href":"/zip", - "html":"

zip source npm

\n
_.zip([arrays])
\n\n

Creates an array of grouped elements, the first of which contains the first\nelements of the given arrays, the second of which contains the second elements\nof the given arrays, and so on.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to process.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of grouped elements.

\n
\n

示例

\n
_.zip(['fred', 'barney'], [30, 40], [true, false]);\n// => [['fred', 30, true], ['barney', 40, false]]\n
\n
\n
" } + "html":"

zip source npm

\n
_.zip([arrays])
\n\n

Creates an array of grouped elements, the first of which contains the first\nelements of the given arrays, the second of which contains the second elements\nof the given arrays, and so on.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to process.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of grouped elements.

\n
\n

示例

\n
_.zip(['fred', 'barney'], [30, 40], [true, false]);\n// => [['fred', 30, true], ['barney', 40, false]]\n
\n
\n
" } ,{ "href":"/zipObject", - "html":"

zipObject source npm

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

This method is like _.fromPairs except that it accepts two arrays,\none of property names and one of corresponding values.

\n
\n\n

参数

\n
    \n
  1. [props=[]] (Array)

    The property names.

    \n
  2. \n
  3. [values=[]] (Array)

    The property values.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
_.zipObject(['fred', 'barney'], [30, 40]);\n// => { 'fred': 30, 'barney': 40 }\n
\n
\n
" } + "html":"

zipObject source npm

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

This method is like _.fromPairs except that it accepts two arrays,\none of property names and one of corresponding values.

\n
\n\n

参数

\n
    \n
  1. [props=[]] (Array)

    The property names.

    \n
  2. \n
  3. [values=[]] (Array)

    The property values.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
_.zipObject(['fred', 'barney'], [30, 40]);\n// => { 'fred': 30, 'barney': 40 }\n
\n
\n
" } ,{ "href":"/zipWith", - "html":"

zipWith source npm

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

This method is like _.zip except that it accepts iteratee to specify\nhow grouped values should be combined. The iteratee is invoked with four\narguments: (accumulator, value, index, group). The first element of each\ngroup is used as the initial accumulator value.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to process.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function to combine grouped values.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of grouped elements.

\n
\n

示例

\n
_.zipWith([1, 2], [10, 20], [100, 200], _.add);\n// => [111, 222]\n
\n
\n
" } + "html":"

zipWith source npm

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

This method is like _.zip except that it accepts iteratee to specify\nhow grouped values should be combined. The iteratee is invoked with four\narguments: (accumulator, value, index, group). The first element of each\ngroup is used as the initial accumulator value.

\n
\n\n

参数

\n
    \n
  1. [arrays] (...Array)

    The arrays to process.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function to combine grouped values.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of grouped elements.

\n
\n

示例

\n
_.zipWith([1, 2], [10, 20], [100, 200], _.add);\n// => [111, 222]\n
\n
\n
" } ,{ "href":"/_", - "html":"

_ source

\n
_(value)
\n\n

Creates a lodash object which wraps value to enable implicit method\nchaining. Methods that operate on and return arrays, collections, and\nfunctions can be chained together. Methods that retrieve a single value or\nmay return a primitive value will automatically end the chain sequence and\nreturn the unwrapped value. Otherwise, the value must be unwrapped with\n_#value.\n
\n
\nExplicit chaining, which must be unwrapped with _#value in all cases,\nmay be enabled using _.chain.\n
\n
\nThe execution of chained methods is lazy, that is, it's deferred until\n_#value is implicitly or explicitly called.\n
\n
\nLazy evaluation allows several methods to support shortcut fusion. Shortcut\nfusion is an optimization to merge iteratee calls; this avoids the creation\nof intermediate arrays and can greatly reduce the number of iteratee executions.\nSections of a chain sequence qualify for shortcut fusion if the section is\napplied to an array of at least two hundred elements and any iteratees\naccept only one argument. The heuristic for whether a section qualifies\nfor shortcut fusion is subject to change.\n
\n
\nChaining is supported in custom builds as long as the _#value method is\ndirectly or indirectly included in the build.\n
\n
\nIn addition to lodash methods, wrappers have Array and String methods.\n
\n
\nThe wrapper Array methods are:
\nconcat, join, pop, push, shift, sort, splice, and unshift\n
\n
\nThe wrapper String methods are:
\nreplace and split\n
\n
\nThe wrapper methods that support shortcut fusion are:
\nat, compact, drop, dropRight, dropWhile, filter, find,\nfindLast, head, initial, last, map, reject, reverse, slice,\ntail, take, takeRight, takeRightWhile, takeWhile, and toArray\n
\n
\nThe chainable wrapper methods are:
\nafter, ary, assign, assignIn, assignInWith, assignWith,\nat, before, bind, bindAll, bindKey, chain, chunk, commit,\ncompact, concat, conforms, constant, countBy, create, curry,\ndebounce, defaults, defaultsDeep, defer, delay, difference,\ndifferenceBy, differenceWith, drop, dropRight, dropRightWhile,\ndropWhile, fill, filter, flatten, flattenDeep, flip, flow,\nflowRight, forEach, forEachRight, forIn, forInRight, forOwn,\nforOwnRight, fromPairs, functions, functionsIn, groupBy, initial,\nintersection, intersectionBy, intersectionWith, invert,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,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,values,valuesIn,without,wrap,xor,xorBy,xorWith,zip,zipObject, andzipWith<br>\n<br>\nThe wrapper methods that are **not** chainable by default are:<br>add,attempt,camelCase,capitalize,ceil,clamp,clone,cloneDeep,cloneDeepWith,cloneWith,deburr,endsWith,eq,escape,escapeRegExp,every,find,findIndex,findKey,findLast,findLastIndex,findLastKey,floor,get,gt,gte,has,hasIn,head,identity,includes,indexOf,inRange,invoke,isArguments,isArray,isArrayLike,isArrayLikeObject,isBoolean,isDate,isElement,isEmpty,isEqual,isEqualWith,isError,isFinite,isFunction,isInteger,isLength,isMatch,isMatchWith,isNaN,isNative,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isRegExp,isSafeInteger,isString,isUndefined,isTypedArray,join,kebabCase,last,lastIndexOf,lowerCase,lowerFirst,lt,lte,max,maxBy,mean,min,minBy,noConflict,noop,now,pad,padEnd,padStart,parseInt,pop,random,reduce,reduceRight,repeat,result,round,runInContext,sample,shift,size,snakeCase,some,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,startCase,startsWith,subtract,sum, sumBy, template, times,\ntoLower, toInteger, toLength, toNumber, toSafeInteger, toString,toUpper,trim,trimEnd,trimStart,truncate,unescape,uniqueId,upperCase,upperFirst,value, andwords`

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to wrap in a lodash instance.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar wrapped = _([1, 2, 3]);\n\n// returns an unwrapped value\nwrapped.reduce(_.add);\n// => 6\n\n// returns a wrapped value\nvar squares = wrapped.map(square);\n\n_.isArray(squares);\n// => false\n\n_.isArray(squares.value());\n// => true\n
\n
\n
" } + "html":"

_ source

\n
_(value)
\n\n

Creates a lodash object which wraps value to enable implicit method\nchaining. Methods that operate on and return arrays, collections, and\nfunctions can be chained together. Methods that retrieve a single value or\nmay return a primitive value will automatically end the chain sequence and\nreturn the unwrapped value. Otherwise, the value must be unwrapped with\n_#value.\n
\n
\nExplicit chaining, which must be unwrapped with _#value in all cases,\nmay be enabled using _.chain.\n
\n
\nThe execution of chained methods is lazy, that is, it's deferred until\n_#value is implicitly or explicitly called.\n
\n
\nLazy evaluation allows several methods to support shortcut fusion. Shortcut\nfusion is an optimization to merge iteratee calls; this avoids the creation\nof intermediate arrays and can greatly reduce the number of iteratee executions.\nSections of a chain sequence qualify for shortcut fusion if the section is\napplied to an array of at least two hundred elements and any iteratees\naccept only one argument. The heuristic for whether a section qualifies\nfor shortcut fusion is subject to change.\n
\n
\nChaining is supported in custom builds as long as the _#value method is\ndirectly or indirectly included in the build.\n
\n
\nIn addition to lodash methods, wrappers have Array and String methods.\n
\n
\nThe wrapper Array methods are:
\nconcat, join, pop, push, shift, sort, splice, and unshift\n
\n
\nThe wrapper String methods are:
\nreplace and split\n
\n
\nThe wrapper methods that support shortcut fusion are:
\nat, compact, drop, dropRight, dropWhile, filter, find,\nfindLast, head, initial, last, map, reject, reverse, slice,\ntail, take, takeRight, takeRightWhile, takeWhile, and toArray\n
\n
\nThe chainable wrapper methods are:
\nafter, ary, assign, assignIn, assignInWith, assignWith,\nat, before, bind, bindAll, bindKey, chain, chunk, commit,\ncompact, concat, conforms, constant, countBy, create, curry,\ndebounce, defaults, defaultsDeep, defer, delay, difference,\ndifferenceBy, differenceWith, drop, dropRight, dropRightWhile,\ndropWhile, fill, filter, flatten, flattenDeep, flip, flow,\nflowRight, forEach, forEachRight, forIn, forInRight, forOwn,\nforOwnRight, fromPairs, functions, functionsIn, groupBy, initial,\nintersection, intersectionBy, intersectionWith, invert,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,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,values,valuesIn,without,wrap,xor,xorBy,xorWith,zip,zipObject, andzipWith<br>\n<br>\nThe wrapper methods that are **not** chainable by default are:<br>add,attempt,camelCase,capitalize,ceil,clamp,clone,cloneDeep,cloneDeepWith,cloneWith,deburr,endsWith,eq,escape,escapeRegExp,every,find,findIndex,findKey,findLast,findLastIndex,findLastKey,floor,get,gt,gte,has,hasIn,head,identity,includes,indexOf,inRange,invoke,isArguments,isArray,isArrayLike,isArrayLikeObject,isBoolean,isDate,isElement,isEmpty,isEqual,isEqualWith,isError,isFinite,isFunction,isInteger,isLength,isMatch,isMatchWith,isNaN,isNative,isNil,isNull,isNumber,isObject,isObjectLike,isPlainObject,isRegExp,isSafeInteger,isString,isUndefined,isTypedArray,join,kebabCase,last,lastIndexOf,lowerCase,lowerFirst,lt,lte,max,maxBy,mean,min,minBy,noConflict,noop,now,pad,padEnd,padStart,parseInt,pop,random,reduce,reduceRight,repeat,result,round,runInContext,sample,shift,size,snakeCase,some,sortedIndex,sortedIndexBy,sortedLastIndex,sortedLastIndexBy,startCase,startsWith,subtract,sum, sumBy, template, times,\ntoLower, toInteger, toLength, toNumber, toSafeInteger, toString,toUpper,trim,trimEnd,trimStart,truncate,unescape,uniqueId,upperCase,upperFirst,value, andwords`

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to wrap in a lodash instance.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar wrapped = _([1, 2, 3]);\n\n// returns an unwrapped value\nwrapped.reduce(_.add);\n// => 6\n\n// returns a wrapped value\nvar squares = wrapped.map(square);\n\n_.isArray(squares);\n// => false\n\n_.isArray(squares.value());\n// => true\n
\n
\n
" } ,{ "href":"/chain", - "html":"

chain source

\n
_.chain(value)
\n\n

Creates a lodash object that wraps value with explicit method chaining enabled.\nThe result of such method chaining must be unwrapped with _#value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to wrap.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney',  'age': 36 },\n  { 'user': 'fred',    'age': 40 },\n  { 'user': 'pebbles', 'age': 1 }\n];\n\nvar youngest = _\n  .chain(users)\n  .sortBy('age')\n  .map(function(o) {\n    return o.user + ' is ' + o.age;\n  })\n  .head()\n  .value();\n// => 'pebbles is 1'\n
\n
\n
" } + "html":"

chain source

\n
_.chain(value)
\n\n

Creates a lodash object that wraps value with explicit method chaining enabled.\nThe result of such method chaining must be unwrapped with _#value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to wrap.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney',  'age': 36 },\n  { 'user': 'fred',    'age': 40 },\n  { 'user': 'pebbles', 'age': 1 }\n];\n\nvar youngest = _\n  .chain(users)\n  .sortBy('age')\n  .map(function(o) {\n    return o.user + ' is ' + o.age;\n  })\n  .head()\n  .value();\n// => 'pebbles is 1'\n
\n
\n
" } ,{ "href":"/prototype-at", - "html":"

prototype.at source

\n
_.prototype.at([paths])
\n\n

This method is the wrapper version of _.at.

\n
\n\n

参数

\n
    \n
  1. [paths] (...(string|string[])

    The property paths of elements to pick, specified individually or in arrays.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n\n_(object).at(['a[0].b.c', 'a[1]']).value();\n// => [3, 4]\n\n_(['a', 'b', 'c']).at(0, 2).value();\n// => ['a', 'c']\n
\n
\n
" } + "html":"

prototype.at source

\n
_.prototype.at([paths])
\n\n

This method is the wrapper version of _.at.

\n
\n\n

参数

\n
    \n
  1. [paths] (...(string|string[])

    The property paths of elements to pick, specified individually or in arrays.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n\n_(object).at(['a[0].b.c', 'a[1]']).value();\n// => [3, 4]\n\n_(['a', 'b', 'c']).at(0, 2).value();\n// => ['a', 'c']\n
\n
\n
" } ,{ "href":"/prototype-chain", - "html":"

prototype.chain source

\n
_.prototype.chain()
\n\n

Enables explicit method chaining on the wrapper object.

\n
\n\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n// without explicit chaining\n_(users).head();\n// => { 'user': 'barney', 'age': 36 }\n\n// with explicit chaining\n_(users)\n  .chain()\n  .head()\n  .pick('user')\n  .value();\n// => { 'user': 'barney' }\n
\n
\n
" } + "html":"

prototype.chain source

\n
_.prototype.chain()
\n\n

Enables explicit method chaining on the wrapper object.

\n
\n\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n// without explicit chaining\n_(users).head();\n// => { 'user': 'barney', 'age': 36 }\n\n// with explicit chaining\n_(users)\n  .chain()\n  .head()\n  .pick('user')\n  .value();\n// => { 'user': 'barney' }\n
\n
\n
" } ,{ "href":"/prototype-commit", - "html":"

prototype.commit source

\n
_.prototype.commit()
\n\n

Executes the chained sequence and returns the wrapped result.

\n
\n\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var array = [1, 2];\nvar wrapped = _(array).push(3);\n\nconsole.log(array);\n// => [1, 2]\n\nwrapped = wrapped.commit();\nconsole.log(array);\n// => [1, 2, 3]\n\nwrapped.last();\n// => 3\n\nconsole.log(array);\n// => [1, 2, 3]\n
\n
\n
" } + "html":"

prototype.commit source

\n
_.prototype.commit()
\n\n

Executes the chained sequence and returns the wrapped result.

\n
\n\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
var array = [1, 2];\nvar wrapped = _(array).push(3);\n\nconsole.log(array);\n// => [1, 2]\n\nwrapped = wrapped.commit();\nconsole.log(array);\n// => [1, 2, 3]\n\nwrapped.last();\n// => 3\n\nconsole.log(array);\n// => [1, 2, 3]\n
\n
\n
" } ,{ "href":"/prototype-next", - "html":"

prototype.next source

\n
_.prototype.next()
\n\n

Gets the next value on a wrapped object following the\niterator protocol.

\n
\n\n

返回值 (Object)

\n

Returns the next iterator value.

\n
\n

示例

\n
var wrapped = _([1, 2]);\n\nwrapped.next();\n// => { 'done': false, 'value': 1 }\n\nwrapped.next();\n// => { 'done': false, 'value': 2 }\n\nwrapped.next();\n// => { 'done': true, 'value': undefined }\n
\n
\n
" } + "html":"

prototype.next source

\n
_.prototype.next()
\n\n

Gets the next value on a wrapped object following the\niterator protocol.

\n
\n\n

返回值 (Object)

\n

Returns the next iterator value.

\n
\n

示例

\n
var wrapped = _([1, 2]);\n\nwrapped.next();\n// => { 'done': false, 'value': 1 }\n\nwrapped.next();\n// => { 'done': false, 'value': 2 }\n\nwrapped.next();\n// => { 'done': true, 'value': undefined }\n
\n
\n
" } ,{ "href":"/prototype-plant", - "html":"

prototype.plant source

\n
_.prototype.plant(value)
\n\n

Creates a clone of the chained sequence planting value as the wrapped value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to plant.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar wrapped = _([1, 2]).map(square);\nvar other = wrapped.plant([3, 4]);\n\nother.value();\n// => [9, 16]\n\nwrapped.value();\n// => [1, 4]\n
\n
\n
" } + "html":"

prototype.plant source

\n
_.prototype.plant(value)
\n\n

Creates a clone of the chained sequence planting value as the wrapped value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to plant.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar wrapped = _([1, 2]).map(square);\nvar other = wrapped.plant([3, 4]);\n\nother.value();\n// => [9, 16]\n\nwrapped.value();\n// => [1, 4]\n
\n
\n
" } ,{ "href":"/prototype-Symbol-iterator", - "html":"

prototype.Symbol.iterator source

\n
_.prototype.Symbol.iterator()
\n\n

Enables the wrapper to be iterable.

\n
\n\n

返回值 (Object)

\n

Returns the wrapper object.

\n
\n

示例

\n
var wrapped = _([1, 2]);\n\nwrapped[Symbol.iterator]() === wrapped;\n// => true\n\nArray.from(wrapped);\n// => [1, 2]\n
\n
\n
" } + "html":"

prototype.Symbol.iterator source

\n
_.prototype.Symbol.iterator()
\n\n

Enables the wrapper to be iterable.

\n
\n\n

返回值 (Object)

\n

Returns the wrapper object.

\n
\n

示例

\n
var wrapped = _([1, 2]);\n\nwrapped[Symbol.iterator]() === wrapped;\n// => true\n\nArray.from(wrapped);\n// => [1, 2]\n
\n
\n
" } ,{ "href":"/prototype-value", - "html":"

prototype.value run, toJSON, valueOf source

\n
_.prototype.value()
\n\n

Executes the chained sequence to extract the unwrapped value.

\n
\n\n

返回值 (*)

\n

Returns the resolved unwrapped value.

\n
\n

示例

\n
_([1, 2, 3]).value();\n// => [1, 2, 3]\n
\n
\n
" } + "html":"

prototype.value run, toJSON, valueOf source

\n
_.prototype.value()
\n\n

Executes the chained sequence to extract the unwrapped value.

\n
\n\n

返回值 (*)

\n

Returns the resolved unwrapped value.

\n
\n

示例

\n
_([1, 2, 3]).value();\n// => [1, 2, 3]\n
\n
\n
" } ,{ "href":"/tap", - "html":"

tap source

\n
_.tap(value, interceptor)
\n\n

This method invokes interceptor and returns value. The interceptor is\ninvoked with one argument; (value). The purpose of this method is to "tap into"\na method chain in order to perform operations on intermediate results within\nthe chain.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to provide to interceptor.

    \n
  2. \n
  3. interceptor (Function)

    The function to invoke.

    \n
  4. \n
\n

返回值 (*)

\n

Returns value.

\n
\n

示例

\n
_([1, 2, 3])\n .tap(function(array) {\n   array.pop();\n })\n .reverse()\n .value();\n// => [2, 1]\n
\n
\n
" } + "html":"

tap source

\n
_.tap(value, interceptor)
\n\n

This method invokes interceptor and returns value. The interceptor is\ninvoked with one argument; (value). The purpose of this method is to "tap into"\na method chain in order to perform operations on intermediate results within\nthe chain.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to provide to interceptor.

    \n
  2. \n
  3. interceptor (Function)

    The function to invoke.

    \n
  4. \n
\n

返回值 (*)

\n

Returns value.

\n
\n

示例

\n
_([1, 2, 3])\n .tap(function(array) {\n   array.pop();\n })\n .reverse()\n .value();\n// => [2, 1]\n
\n
\n
" } ,{ "href":"/thru", - "html":"

thru source

\n
_.thru(value, interceptor)
\n\n

This method is like _.tap except that it returns the result of interceptor.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to provide to interceptor.

    \n
  2. \n
  3. interceptor (Function)

    The function to invoke.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the result of interceptor.

\n
\n

示例

\n
_('  abc  ')\n .chain()\n .trim()\n .thru(function(value) {\n   return [value];\n })\n .value();\n// => ['abc']\n
\n
\n
" } + "html":"

thru source

\n
_.thru(value, interceptor)
\n\n

This method is like _.tap except that it returns the result of interceptor.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to provide to interceptor.

    \n
  2. \n
  3. interceptor (Function)

    The function to invoke.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the result of interceptor.

\n
\n

示例

\n
_('  abc  ')\n .chain()\n .trim()\n .thru(function(value) {\n   return [value];\n })\n .value();\n// => ['abc']\n
\n
\n
" } ,{ "href":"/wrapperFlatMap", - "html":"

wrapperFlatMap source

\n
_.wrapperFlatMap([iteratee=_.identity])
\n\n

This method is the wrapper version of _.flatMap.

\n
\n\n

参数

\n
    \n
  1. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
function duplicate(n) {\n  return [n, n];\n}\n\n_([1, 2]).flatMap(duplicate).value();\n// => [1, 1, 2, 2]\n
\n
\n
" } + "html":"

wrapperFlatMap source

\n
_.wrapperFlatMap([iteratee=_.identity])
\n\n

This method is the wrapper version of _.flatMap.

\n
\n\n

参数

\n
    \n
  1. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the new lodash wrapper instance.

\n
\n

示例

\n
function duplicate(n) {\n  return [n, n];\n}\n\n_([1, 2]).flatMap(duplicate).value();\n// => [1, 1, 2, 2]\n
\n
\n
" } ,{ "href":"/countBy", - "html":"

countBy source npm

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

Creates an object composed of keys generated from the results of running\neach element of collection through iteratee. The corresponding value\nof each key is the number of times the key was returned by iteratee.\nThe iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the composed aggregate object.

\n
\n

示例

\n
_.countBy([6.1, 4.2, 6.3], Math.floor);\n// => { '4': 1, '6': 2 }\n\n_.countBy(['one', 'two', 'three'], 'length');\n// => { '3': 2, '5': 1 }\n
\n
\n
" } + "html":"

countBy source npm

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

Creates an object composed of keys generated from the results of running\neach element of collection through iteratee. The corresponding value\nof each key is the number of times the key was returned by iteratee.\nThe iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the composed aggregate object.

\n
\n

示例

\n
_.countBy([6.1, 4.2, 6.3], Math.floor);\n// => { '4': 1, '6': 2 }\n\n_.countBy(['one', 'two', 'three'], 'length');\n// => { '3': 2, '5': 1 }\n
\n
\n
" } ,{ "href":"/every", - "html":"

every source npm

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

Checks if predicate returns truthy for all elements of collection.\nIteration is stopped once predicate returns falsey. The predicate is\ninvoked with three arguments: (value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if all elements pass the predicate check, else false.

\n
\n

示例

\n
_.every([true, 1, null, 'yes'], Boolean);\n// => false\n\nvar users = [\n  { 'user': 'barney', 'active': false },\n  { 'user': 'fred',   'active': false }\n];\n\n// using the `_.matches` callback shorthand\n_.every(users, { 'user': 'barney', 'active': false });\n// => false\n\n// using the `_.matchesProperty` callback shorthand\n_.every(users, ['active', false]);\n// => true\n\n// using the `_.property` callback shorthand\n_.every(users, 'active');\n// => false\n
\n
\n
" } + "html":"

every source npm

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

Checks if predicate returns truthy for all elements of collection.\nIteration is stopped once predicate returns falsey. The predicate is\ninvoked with three arguments: (value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if all elements pass the predicate check, else false.

\n
\n

示例

\n
_.every([true, 1, null, 'yes'], Boolean);\n// => false\n\nvar users = [\n  { 'user': 'barney', 'active': false },\n  { 'user': 'fred',   'active': false }\n];\n\n// using the `_.matches` callback shorthand\n_.every(users, { 'user': 'barney', 'active': false });\n// => false\n\n// using the `_.matchesProperty` callback shorthand\n_.every(users, ['active', false]);\n// => true\n\n// using the `_.property` callback shorthand\n_.every(users, 'active');\n// => false\n
\n
\n
" } ,{ "href":"/filter", - "html":"

filter source npm

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

Iterates over elements of collection, returning an array of all elements\npredicate returns truthy for. The predicate is invoked with three arguments:
\n(value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new filtered array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney', 'age': 36, 'active': true },\n  { 'user': 'fred',   'age': 40, 'active': false }\n];\n\nresolve( _.filter(users, function(o) { return !o.active; }) );\n// => ['fred']\n\n// using the `_.matches` callback shorthand\nresolve( _.filter(users, { 'age': 36, 'active': true }) );\n// => ['barney']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.filter(users, ['active', false]) );\n// => ['fred']\n\n// using the `_.property` callback shorthand\nresolve( _.filter(users, 'active') );\n// => ['barney']\n
\n
\n
" } + "html":"

filter source npm

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

Iterates over elements of collection, returning an array of all elements\npredicate returns truthy for. The predicate is invoked with three arguments:
\n(value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new filtered array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney', 'age': 36, 'active': true },\n  { 'user': 'fred',   'age': 40, 'active': false }\n];\n\nresolve( _.filter(users, function(o) { return !o.active; }) );\n// => ['fred']\n\n// using the `_.matches` callback shorthand\nresolve( _.filter(users, { 'age': 36, 'active': true }) );\n// => ['barney']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.filter(users, ['active', false]) );\n// => ['fred']\n\n// using the `_.property` callback shorthand\nresolve( _.filter(users, 'active') );\n// => ['barney']\n
\n
\n
" } ,{ "href":"/find", - "html":"

find source npm

\n
_.find(collection, [predicate=_.identity])
\n\n

Iterates over elements of collection, returning the first element\npredicate returns truthy for. The predicate is invoked with three arguments:
\n(value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the matched element, else undefined.

\n
\n

示例

\n
var resolve = _.partial(_.result, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'age': 36, 'active': true },\n  { 'user': 'fred',    'age': 40, 'active': false },\n  { 'user': 'pebbles', 'age': 1,  'active': true }\n];\n\nresolve( _.find(users, function(o) { return o.age < 40; }) );\n// => 'barney'\n\n// using the `_.matches` callback shorthand\nresolve( _.find(users, { 'age': 1, 'active': true }) );\n// => 'pebbles'\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.find(users, ['active', false]) );\n// => 'fred'\n\n// using the `_.property` callback shorthand\nresolve( _.find(users, 'active') );\n// => 'barney'\n
\n
\n
" } + "html":"

find source npm

\n
_.find(collection, [predicate=_.identity])
\n\n

Iterates over elements of collection, returning the first element\npredicate returns truthy for. The predicate is invoked with three arguments:
\n(value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the matched element, else undefined.

\n
\n

示例

\n
var resolve = _.partial(_.result, _, 'user');\n\nvar users = [\n  { 'user': 'barney',  'age': 36, 'active': true },\n  { 'user': 'fred',    'age': 40, 'active': false },\n  { 'user': 'pebbles', 'age': 1,  'active': true }\n];\n\nresolve( _.find(users, function(o) { return o.age < 40; }) );\n// => 'barney'\n\n// using the `_.matches` callback shorthand\nresolve( _.find(users, { 'age': 1, 'active': true }) );\n// => 'pebbles'\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.find(users, ['active', false]) );\n// => 'fred'\n\n// using the `_.property` callback shorthand\nresolve( _.find(users, 'active') );\n// => 'barney'\n
\n
\n
" } ,{ "href":"/findLast", - "html":"

findLast source npm

\n
_.findLast(collection, [predicate=_.identity])
\n\n

This method is like _.find except that it iterates over elements of\ncollection from right to left.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the matched element, else undefined.

\n
\n

示例

\n
_.findLast([1, 2, 3, 4], function(n) {\n  return n % 2 == 1;\n});\n// => 3\n
\n
\n
" } + "html":"

findLast source npm

\n
_.findLast(collection, [predicate=_.identity])
\n\n

This method is like _.find except that it iterates over elements of\ncollection from right to left.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the matched element, else undefined.

\n
\n

示例

\n
_.findLast([1, 2, 3, 4], function(n) {\n  return n % 2 == 1;\n});\n// => 3\n
\n
\n
" } ,{ "href":"/forEach", - "html":"

forEach each source npm

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

Iterates over elements of collection invoking iteratee for each element.\nThe iteratee is invoked with three arguments: (value, index|key, collection).\nIteratee functions may exit iteration early by explicitly returning false.\n
\n
\nNote: As with other "Collections" methods, objects with a "length" property\nare iterated like arrays. To avoid this behavior use _.forIn or _.forOwn\nfor object iteration.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array|Object)

\n

Returns collection.

\n
\n

示例

\n
_([1, 2]).forEach(function(value) {\n  console.log(value);\n});\n// => logs `1` then `2`\n\n_.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n  console.log(key);\n});\n// => logs 'a' then 'b' (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

forEach each source npm

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

Iterates over elements of collection invoking iteratee for each element.\nThe iteratee is invoked with three arguments: (value, index|key, collection).\nIteratee functions may exit iteration early by explicitly returning false.\n
\n
\nNote: As with other "Collections" methods, objects with a "length" property\nare iterated like arrays. To avoid this behavior use _.forIn or _.forOwn\nfor object iteration.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array|Object)

\n

Returns collection.

\n
\n

示例

\n
_([1, 2]).forEach(function(value) {\n  console.log(value);\n});\n// => logs `1` then `2`\n\n_.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n  console.log(key);\n});\n// => logs 'a' then 'b' (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/forEachRight", - "html":"

forEachRight eachRight source npm

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

This method is like _.forEach except that it iterates over elements of\ncollection from right to left.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array|Object)

\n

Returns collection.

\n
\n

示例

\n
_.forEachRight([1, 2], function(value) {\n  console.log(value);\n});\n// => logs `2` then `1`\n
\n
\n
" } + "html":"

forEachRight eachRight source npm

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

This method is like _.forEach except that it iterates over elements of\ncollection from right to left.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array|Object)

\n

Returns collection.

\n
\n

示例

\n
_.forEachRight([1, 2], function(value) {\n  console.log(value);\n});\n// => logs `2` then `1`\n
\n
\n
" } ,{ "href":"/groupBy", - "html":"

groupBy source npm

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

Creates an object composed of keys generated from the results of running\neach element of collection through iteratee. The corresponding value\nof each key is an array of the elements responsible for generating the key.\nThe iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the composed aggregate object.

\n
\n

示例

\n
_.groupBy([6.1, 4.2, 6.3], Math.floor);\n// => { '4': [4.2], '6': [6.1, 6.3] }\n\n// using the `_.property` callback shorthand\n_.groupBy(['one', 'two', 'three'], 'length');\n// => { '3': ['one', 'two'], '5': ['three'] }\n
\n
\n
" } + "html":"

groupBy source npm

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

Creates an object composed of keys generated from the results of running\neach element of collection through iteratee. The corresponding value\nof each key is an array of the elements responsible for generating the key.\nThe iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the composed aggregate object.

\n
\n

示例

\n
_.groupBy([6.1, 4.2, 6.3], Math.floor);\n// => { '4': [4.2], '6': [6.1, 6.3] }\n\n// using the `_.property` callback shorthand\n_.groupBy(['one', 'two', 'three'], 'length');\n// => { '3': ['one', 'two'], '5': ['three'] }\n
\n
\n
" } ,{ "href":"/includes", - "html":"

includes source npm

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

Checks if value is in collection. If collection is a string it's checked\nfor a substring of value, otherwise SameValueZero\nis used for equality comparisons. If fromIndex is negative, it's used as\nthe offset from the end of collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object|string)

    The collection to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
  5. [fromIndex=0] (number)

    The index to search from.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if value is found, else false.

\n
\n

示例

\n
_.includes([1, 2, 3], 1);\n// => true\n\n_.includes([1, 2, 3], 1, 2);\n// => false\n\n_.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n// => true\n\n_.includes('pebbles', 'eb');\n// => true\n
\n
\n
" } + "html":"

includes source npm

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

Checks if value is in collection. If collection is a string it's checked\nfor a substring of value, otherwise SameValueZero\nis used for equality comparisons. If fromIndex is negative, it's used as\nthe offset from the end of collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object|string)

    The collection to search.

    \n
  2. \n
  3. value (*)

    The value to search for.

    \n
  4. \n
  5. [fromIndex=0] (number)

    The index to search from.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if value is found, else false.

\n
\n

示例

\n
_.includes([1, 2, 3], 1);\n// => true\n\n_.includes([1, 2, 3], 1, 2);\n// => false\n\n_.includes({ 'user': 'fred', 'age': 40 }, 'fred');\n// => true\n\n_.includes('pebbles', 'eb');\n// => true\n
\n
\n
" } ,{ "href":"/invokeMap", - "html":"

invokeMap source npm

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

Invokes the method at path of each element in collection, returning\nan array of the results of each invoked method. Any additional arguments\nare provided to each invoked method. If methodName is a function it's\ninvoked for, and this bound to, each element in collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. path (Array|Function|string)

    The path of the method to invoke or the function invoked per iteration.

    \n
  4. \n
  5. [args] (...*)

    The arguments to invoke each method with.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the array of results.

\n
\n

示例

\n
_.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n// => [[1, 5, 7], [1, 2, 3]]\n\n_.invokeMap([123, 456], String.prototype.split, '');\n// => [['1', '2', '3'], ['4', '5', '6']]\n
\n
\n
" } + "html":"

invokeMap source npm

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

Invokes the method at path of each element in collection, returning\nan array of the results of each invoked method. Any additional arguments\nare provided to each invoked method. If methodName is a function it's\ninvoked for, and this bound to, each element in collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. path (Array|Function|string)

    The path of the method to invoke or the function invoked per iteration.

    \n
  4. \n
  5. [args] (...*)

    The arguments to invoke each method with.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the array of results.

\n
\n

示例

\n
_.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n// => [[1, 5, 7], [1, 2, 3]]\n\n_.invokeMap([123, 456], String.prototype.split, '');\n// => [['1', '2', '3'], ['4', '5', '6']]\n
\n
\n
" } ,{ "href":"/keyBy", - "html":"

keyBy source npm

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

Creates an object composed of keys generated from the results of running\neach element of collection through iteratee. The corresponding value\nof each key is the last element responsible for generating the key. The\niteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the composed aggregate object.

\n
\n

示例

\n
var keyData = [\n  { 'dir': 'left', 'code': 97 },\n  { 'dir': 'right', 'code': 100 }\n];\n\n_.keyBy(keyData, 'dir');\n// => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n\n_.keyBy(keyData, function(o) {\n  return String.fromCharCode(o.code);\n});\n// => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n
\n
\n
" } + "html":"

keyBy source npm

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

Creates an object composed of keys generated from the results of running\neach element of collection through iteratee. The corresponding value\nof each key is the last element responsible for generating the key. The\niteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the composed aggregate object.

\n
\n

示例

\n
var keyData = [\n  { 'dir': 'left', 'code': 97 },\n  { 'dir': 'right', 'code': 100 }\n];\n\n_.keyBy(keyData, 'dir');\n// => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n\n_.keyBy(keyData, function(o) {\n  return String.fromCharCode(o.code);\n});\n// => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n
\n
\n
" } ,{ "href":"/map", - "html":"

map source npm

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

Creates an array of values by running each element in collection through\niteratee. The iteratee is invoked with three arguments:
\n(value, index|key, collection).\n
\n
\nMany lodash methods are guarded to work as iteratees for methods like\n_.every, _.filter, _.map, _.mapValues, _.reject, and _.some.\n
\n
\nThe guarded methods are:
\nary, curry, curryRight, drop, dropRight, every, fill,\ninvert, parseInt, random, range, rangeRight, slice, some,\nsortBy, take, takeRight, template, trim, trimEnd, trimStart,\nand words

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new mapped array.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\n_.map([1, 2], square);\n// => [3, 6]\n\n_.map({ 'a': 1, 'b': 2 }, square);\n// => [3, 6] (iteration order is not guaranteed)\n\nvar users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\n// using the `_.property` callback shorthand\n_.map(users, 'user');\n// => ['barney', 'fred']\n
\n
\n
" } + "html":"

map source npm

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

Creates an array of values by running each element in collection through\niteratee. The iteratee is invoked with three arguments:
\n(value, index|key, collection).\n
\n
\nMany lodash methods are guarded to work as iteratees for methods like\n_.every, _.filter, _.map, _.mapValues, _.reject, and _.some.\n
\n
\nThe guarded methods are:
\nary, curry, curryRight, drop, dropRight, every, fill,\ninvert, parseInt, random, range, rangeRight, slice, some,\nsortBy, take, takeRight, template, trim, trimEnd, trimStart,\nand words

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new mapped array.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\n_.map([1, 2], square);\n// => [3, 6]\n\n_.map({ 'a': 1, 'b': 2 }, square);\n// => [3, 6] (iteration order is not guaranteed)\n\nvar users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\n// using the `_.property` callback shorthand\n_.map(users, 'user');\n// => ['barney', 'fred']\n
\n
\n
" } ,{ "href":"/orderBy", - "html":"

orderBy source npm

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

This method is like _.sortBy except that it allows specifying the sort\norders of the iteratees to sort by. If orders is unspecified, all values\nare sorted in ascending order. Otherwise, specify an order of "desc" for\ndescending or "asc" for ascending sort order of corresponding values.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratees=[_.identity]] (Function[]|Object[]|string[])

    The iteratees to sort by.

    \n
  4. \n
  5. [orders] (string[])

    The sort orders of iteratees.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new sorted array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, _.values);\n\nvar users = [\n  { 'user': 'fred',   'age': 48 },\n  { 'user': 'barney', 'age': 34 },\n  { 'user': 'fred',   'age': 42 },\n  { 'user': 'barney', 'age': 36 }\n];\n\n// sort by `user` in ascending order and by `age` in descending order\nresolve( _.orderBy(users, ['user', 'age'], ['asc', 'desc']) );\n// => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n
\n
\n
" } + "html":"

orderBy source npm

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

This method is like _.sortBy except that it allows specifying the sort\norders of the iteratees to sort by. If orders is unspecified, all values\nare sorted in ascending order. Otherwise, specify an order of "desc" for\ndescending or "asc" for ascending sort order of corresponding values.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratees=[_.identity]] (Function[]|Object[]|string[])

    The iteratees to sort by.

    \n
  4. \n
  5. [orders] (string[])

    The sort orders of iteratees.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new sorted array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, _.values);\n\nvar users = [\n  { 'user': 'fred',   'age': 48 },\n  { 'user': 'barney', 'age': 34 },\n  { 'user': 'fred',   'age': 42 },\n  { 'user': 'barney', 'age': 36 }\n];\n\n// sort by `user` in ascending order and by `age` in descending order\nresolve( _.orderBy(users, ['user', 'age'], ['asc', 'desc']) );\n// => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n
\n
\n
" } ,{ "href":"/partition", - "html":"

partition source npm

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

Creates an array of elements split into two groups, the first of which\ncontains elements predicate returns truthy for, while the second of which\ncontains elements predicate returns falsey for. The predicate is invoked\nwith three arguments: (value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the array of grouped elements.

\n
\n

示例

\n
var resolve = function(result) {\n  return _.map(result, function(array) { return _.map(array, 'user'); });\n};\n\nvar users = [\n  { 'user': 'barney',  'age': 36, 'active': false },\n  { 'user': 'fred',    'age': 40, 'active': true },\n  { 'user': 'pebbles', 'age': 1,  'active': false }\n];\n\nresolve( _.partition(users, function(o) { return o.active; }) );\n// => [['fred'], ['barney', 'pebbles']]\n\n// using the `_.matches` callback shorthand\nresolve( _.partition(users, { 'age': 1, 'active': false }) );\n// => [['pebbles'], ['barney', 'fred']]\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.partition(users, ['active', false]) );\n// => [['barney', 'pebbles'], ['fred']]\n\n// using the `_.property` callback shorthand\nresolve( _.partition(users, 'active') );\n// => [['fred'], ['barney', 'pebbles']]\n
\n
\n
" } + "html":"

partition source npm

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

Creates an array of elements split into two groups, the first of which\ncontains elements predicate returns truthy for, while the second of which\ncontains elements predicate returns falsey for. The predicate is invoked\nwith three arguments: (value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the array of grouped elements.

\n
\n

示例

\n
var resolve = function(result) {\n  return _.map(result, function(array) { return _.map(array, 'user'); });\n};\n\nvar users = [\n  { 'user': 'barney',  'age': 36, 'active': false },\n  { 'user': 'fred',    'age': 40, 'active': true },\n  { 'user': 'pebbles', 'age': 1,  'active': false }\n];\n\nresolve( _.partition(users, function(o) { return o.active; }) );\n// => [['fred'], ['barney', 'pebbles']]\n\n// using the `_.matches` callback shorthand\nresolve( _.partition(users, { 'age': 1, 'active': false }) );\n// => [['pebbles'], ['barney', 'fred']]\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.partition(users, ['active', false]) );\n// => [['barney', 'pebbles'], ['fred']]\n\n// using the `_.property` callback shorthand\nresolve( _.partition(users, 'active') );\n// => [['fred'], ['barney', 'pebbles']]\n
\n
\n
" } ,{ "href":"/reduce", - "html":"

reduce source npm

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

Reduces collection to a value which is the accumulated result of running\neach element in collection through iteratee, where each successive\ninvocation is supplied the return value of the previous. If accumulator\nis not provided the first element of collection is used as the initial\nvalue. The iteratee is invoked with four arguments:
\n(accumulator, value, index|key, collection).\n
\n
\nMany lodash methods are guarded to work as iteratees for methods like\n_.reduce, _.reduceRight, and _.transform.\n
\n
\nThe guarded methods are:
\nassign, defaults, defaultsDeep, includes, merge, orderBy,\nand sortBy

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
  5. [accumulator] (*)

    The initial value.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the accumulated value.

\n
\n

示例

\n
_.reduce([1, 2], function(sum, n) {\n  return sum + n;\n});\n// => 3\n\n_.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n  (result[value] || (result[value] = [])).push(key);\n  return result;\n}, {});\n// => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

reduce source npm

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

Reduces collection to a value which is the accumulated result of running\neach element in collection through iteratee, where each successive\ninvocation is supplied the return value of the previous. If accumulator\nis not provided the first element of collection is used as the initial\nvalue. The iteratee is invoked with four arguments:
\n(accumulator, value, index|key, collection).\n
\n
\nMany lodash methods are guarded to work as iteratees for methods like\n_.reduce, _.reduceRight, and _.transform.\n
\n
\nThe guarded methods are:
\nassign, defaults, defaultsDeep, includes, merge, orderBy,\nand sortBy

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
  5. [accumulator] (*)

    The initial value.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the accumulated value.

\n
\n

示例

\n
_.reduce([1, 2], function(sum, n) {\n  return sum + n;\n});\n// => 3\n\n_.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n  (result[value] || (result[value] = [])).push(key);\n  return result;\n}, {});\n// => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/reduceRight", - "html":"

reduceRight source npm

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

This method is like _.reduce except that it iterates over elements of\ncollection from right to left.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
  5. [accumulator] (*)

    The initial value.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the accumulated value.

\n
\n

示例

\n
var array = [[0, 1], [2, 3], [4, 5]];\n\n_.reduceRight(array, function(flattened, other) {\n  return flattened.concat(other);\n}, []);\n// => [4, 5, 2, 3, 0, 1]\n
\n
\n
" } + "html":"

reduceRight source npm

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

This method is like _.reduce except that it iterates over elements of\ncollection from right to left.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
  5. [accumulator] (*)

    The initial value.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the accumulated value.

\n
\n

示例

\n
var array = [[0, 1], [2, 3], [4, 5]];\n\n_.reduceRight(array, function(flattened, other) {\n  return flattened.concat(other);\n}, []);\n// => [4, 5, 2, 3, 0, 1]\n
\n
\n
" } ,{ "href":"/reject", - "html":"

reject source npm

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

The opposite of _.filter; this method returns the elements of collection\nthat predicate does not return truthy for.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new filtered array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney', 'age': 36, 'active': false },\n  { 'user': 'fred',   'age': 40, 'active': true }\n];\n\nresolve( _.reject(users, function(o) { return !o.active; }) );\n// => ['fred']\n\n// using the `_.matches` callback shorthand\nresolve( _.reject(users, { 'age': 40, 'active': true }) );\n// => ['barney']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.reject(users, ['active', false]) );\n// => ['fred']\n\n// using the `_.property` callback shorthand\nresolve( _.reject(users, 'active') );\n// => ['barney']\n
\n
\n
" } + "html":"

reject source npm

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

The opposite of _.filter; this method returns the elements of collection\nthat predicate does not return truthy for.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new filtered array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, 'user');\n\nvar users = [\n  { 'user': 'barney', 'age': 36, 'active': false },\n  { 'user': 'fred',   'age': 40, 'active': true }\n];\n\nresolve( _.reject(users, function(o) { return !o.active; }) );\n// => ['fred']\n\n// using the `_.matches` callback shorthand\nresolve( _.reject(users, { 'age': 40, 'active': true }) );\n// => ['barney']\n\n// using the `_.matchesProperty` callback shorthand\nresolve( _.reject(users, ['active', false]) );\n// => ['fred']\n\n// using the `_.property` callback shorthand\nresolve( _.reject(users, 'active') );\n// => ['barney']\n
\n
\n
" } ,{ "href":"/sample", - "html":"

sample source npm

\n
_.sample(collection)
\n\n

Gets a random element from collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to sample.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the random element.

\n
\n

示例

\n
_.sample([1, 2, 3, 4]);\n// => 2\n
\n
\n
" } + "html":"

sample source npm

\n
_.sample(collection)
\n\n

Gets a random element from collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to sample.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the random element.

\n
\n

示例

\n
_.sample([1, 2, 3, 4]);\n// => 2\n
\n
\n
" } ,{ "href":"/sampleSize", - "html":"

sampleSize source npm

\n
_.sampleSize(collection, [n=0])
\n\n

Gets n random elements from collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to sample.

    \n
  2. \n
  3. [n=0] (number)

    The number of elements to sample.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the random elements.

\n
\n

示例

\n
_.sampleSize([1, 2, 3, 4], 2);\n// => [3, 1]\n
\n
\n
" } + "html":"

sampleSize source npm

\n
_.sampleSize(collection, [n=0])
\n\n

Gets n random elements from collection.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to sample.

    \n
  2. \n
  3. [n=0] (number)

    The number of elements to sample.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the random elements.

\n
\n

示例

\n
_.sampleSize([1, 2, 3, 4], 2);\n// => [3, 1]\n
\n
\n
" } ,{ "href":"/shuffle", - "html":"

shuffle source npm

\n
_.shuffle(collection)
\n\n

Creates an array of shuffled values, using a version of the\nFisher-Yates shuffle.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to shuffle.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new shuffled array.

\n
\n

示例

\n
_.shuffle([1, 2, 3, 4]);\n// => [4, 1, 3, 2]\n
\n
\n
" } + "html":"

shuffle source npm

\n
_.shuffle(collection)
\n\n

Creates an array of shuffled values, using a version of the\nFisher-Yates shuffle.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to shuffle.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new shuffled array.

\n
\n

示例

\n
_.shuffle([1, 2, 3, 4]);\n// => [4, 1, 3, 2]\n
\n
\n
" } ,{ "href":"/size", - "html":"

size source npm

\n
_.size(collection)
\n\n

Gets the size of collection by returning its length for array-like\nvalues or the number of own enumerable properties for objects.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to inspect.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the collection size.

\n
\n

示例

\n
_.size([1, 2, 3]);\n// => 3\n\n_.size({ 'a': 1, 'b': 2 });\n// => 2\n\n_.size('pebbles');\n// => 7\n
\n
\n
" } + "html":"

size source npm

\n
_.size(collection)
\n\n

Gets the size of collection by returning its length for array-like\nvalues or the number of own enumerable properties for objects.

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to inspect.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the collection size.

\n
\n

示例

\n
_.size([1, 2, 3]);\n// => 3\n\n_.size({ 'a': 1, 'b': 2 });\n// => 2\n\n_.size('pebbles');\n// => 7\n
\n
\n
" } ,{ "href":"/some", - "html":"

some source npm

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

Checks if predicate returns truthy for any element of collection.\nIteration is stopped once predicate returns truthy. The predicate is\ninvoked with three arguments: (value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if any element passes the predicate check, else false.

\n
\n

示例

\n
_.some([null, 0, 'yes', false], Boolean);\n// => true\n\nvar users = [\n  { 'user': 'barney', 'active': true },\n  { 'user': 'fred',   'active': false }\n];\n\n// using the `_.matches` callback shorthand\n_.some(users, { 'user': 'barney', 'active': false });\n// => false\n\n// using the `_.matchesProperty` callback shorthand\n_.some(users, ['active', false]);\n// => true\n\n// using the `_.property` callback shorthand\n_.some(users, 'active');\n// => true\n
\n
\n
" } + "html":"

some source npm

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

Checks if predicate returns truthy for any element of collection.\nIteration is stopped once predicate returns truthy. The predicate is\ninvoked with three arguments: (value, index|key, collection).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if any element passes the predicate check, else false.

\n
\n

示例

\n
_.some([null, 0, 'yes', false], Boolean);\n// => true\n\nvar users = [\n  { 'user': 'barney', 'active': true },\n  { 'user': 'fred',   'active': false }\n];\n\n// using the `_.matches` callback shorthand\n_.some(users, { 'user': 'barney', 'active': false });\n// => false\n\n// using the `_.matchesProperty` callback shorthand\n_.some(users, ['active', false]);\n// => true\n\n// using the `_.property` callback shorthand\n_.some(users, 'active');\n// => true\n
\n
\n
" } ,{ "href":"/sortBy", - "html":"

sortBy source npm

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

Creates an array of elements, sorted in ascending order by the results of\nrunning each element in a collection through each iteratee. This method\nperforms a stable sort, that is, it preserves the original sort order of\nequal elements. The iteratees are invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratees=[_.identity]] (...(Function|Function[]|Object|Object[]|string|string[])

    The iteratees to sort by, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new sorted array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, _.values);\n\nvar users = [\n  { 'user': 'fred',   'age': 48 },\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 42 },\n  { 'user': 'barney', 'age': 34 }\n];\n\nresolve( _.sortBy(users, function(o) { return o.user; }) );\n// => // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n\nresolve( _.sortBy(users, ['user', 'age']) );\n// => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]\n\nresolve( _.sortBy(users, 'user', function(o) {\n  return Math.floor(o.age / 10);\n}) );\n// => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n
\n
\n
" } + "html":"

sortBy source npm

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

Creates an array of elements, sorted in ascending order by the results of\nrunning each element in a collection through each iteratee. This method\nperforms a stable sort, that is, it preserves the original sort order of\nequal elements. The iteratees are invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. collection (Array|Object)

    The collection to iterate over.

    \n
  2. \n
  3. [iteratees=[_.identity]] (...(Function|Function[]|Object|Object[]|string|string[])

    The iteratees to sort by, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new sorted array.

\n
\n

示例

\n
var resolve = _.partial(_.map, _, _.values);\n\nvar users = [\n  { 'user': 'fred',   'age': 48 },\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 42 },\n  { 'user': 'barney', 'age': 34 }\n];\n\nresolve( _.sortBy(users, function(o) { return o.user; }) );\n// => // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n\nresolve( _.sortBy(users, ['user', 'age']) );\n// => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]\n\nresolve( _.sortBy(users, 'user', function(o) {\n  return Math.floor(o.age / 10);\n}) );\n// => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]\n
\n
\n
" } ,{ "href":"/now", - "html":"

now source npm

\n
_.now()
\n\n

Gets the timestamp of the number of milliseconds that have elapsed since\nthe Unix epoch (1 January 1970 00:00:00 UTC).

\n
\n\n

返回值 (number)

\n

Returns the timestamp.

\n
\n

示例

\n
_.defer(function(stamp) {\n  console.log(_.now() - stamp);\n}, _.now());\n// => logs the number of milliseconds it took for the deferred function to be invoked\n
\n
\n
" } + "html":"

now source npm

\n
_.now()
\n\n

Gets the timestamp of the number of milliseconds that have elapsed since\nthe Unix epoch (1 January 1970 00:00:00 UTC).

\n
\n\n

返回值 (number)

\n

Returns the timestamp.

\n
\n

示例

\n
_.defer(function(stamp) {\n  console.log(_.now() - stamp);\n}, _.now());\n// => logs the number of milliseconds it took for the deferred function to be invoked\n
\n
\n
" } ,{ "href":"/after", - "html":"

after source npm

\n
_.after(n, func)
\n\n

The opposite of _.before; this method creates a function that invokes\nfunc once it's called n or more times.

\n
\n\n

参数

\n
    \n
  1. n (number)

    The number of calls before func is invoked.

    \n
  2. \n
  3. func (Function)

    The function to restrict.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new restricted function.

\n
\n

示例

\n
var saves = ['profile', 'settings'];\n\nvar done = _.after(saves.length, function() {\n  console.log('done saving!');\n});\n\n_.forEach(saves, function(type) {\n  asyncSave({ 'type': type, 'complete': done });\n});\n// => logs 'done saving!' after the two async saves have completed\n
\n
\n
" } + "html":"

after source npm

\n
_.after(n, func)
\n\n

The opposite of _.before; this method creates a function that invokes\nfunc once it's called n or more times.

\n
\n\n

参数

\n
    \n
  1. n (number)

    The number of calls before func is invoked.

    \n
  2. \n
  3. func (Function)

    The function to restrict.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new restricted function.

\n
\n

示例

\n
var saves = ['profile', 'settings'];\n\nvar done = _.after(saves.length, function() {\n  console.log('done saving!');\n});\n\n_.forEach(saves, function(type) {\n  asyncSave({ 'type': type, 'complete': done });\n});\n// => logs 'done saving!' after the two async saves have completed\n
\n
\n
" } ,{ "href":"/ary", - "html":"

ary source npm

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

Creates a function that accepts up to n arguments, ignoring any\nadditional arguments.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to cap arguments for.

    \n
  2. \n
  3. [n=func.length] (number)

    The arity cap.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
_.map(['6', '8', '10'], _.ary(parseInt, 1));\n// => [6, 8, 10]\n
\n
\n
" } + "html":"

ary source npm

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

Creates a function that accepts up to n arguments, ignoring any\nadditional arguments.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to cap arguments for.

    \n
  2. \n
  3. [n=func.length] (number)

    The arity cap.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
_.map(['6', '8', '10'], _.ary(parseInt, 1));\n// => [6, 8, 10]\n
\n
\n
" } ,{ "href":"/before", - "html":"

before source npm

\n
_.before(n, func)
\n\n

Creates a function that invokes func, with the this binding and arguments\nof the created function, while it's called less than n times. Subsequent\ncalls to the created function return the result of the last func invocation.

\n
\n\n

参数

\n
    \n
  1. n (number)

    The number of calls at which func is no longer invoked.

    \n
  2. \n
  3. func (Function)

    The function to restrict.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new restricted function.

\n
\n

示例

\n
jQuery(element).on('click', _.before(5, addContactToList));\n// => allows adding up to 4 contacts to the list\n
\n
\n
" } + "html":"

before source npm

\n
_.before(n, func)
\n\n

Creates a function that invokes func, with the this binding and arguments\nof the created function, while it's called less than n times. Subsequent\ncalls to the created function return the result of the last func invocation.

\n
\n\n

参数

\n
    \n
  1. n (number)

    The number of calls at which func is no longer invoked.

    \n
  2. \n
  3. func (Function)

    The function to restrict.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new restricted function.

\n
\n

示例

\n
jQuery(element).on('click', _.before(5, addContactToList));\n// => allows adding up to 4 contacts to the list\n
\n
\n
" } ,{ "href":"/bind", - "html":"

bind source npm

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

Creates a function that invokes func with the this binding of thisArg\nand prepends any additional _.bind arguments to those provided to the\nbound function.\n
\n
\nThe _.bind.placeholder value, which defaults to _ in monolithic builds,\nmay be used as a placeholder for partially applied arguments.\n
\n
\nNote: Unlike native Function#bind this method doesn't set the "length"\nproperty of bound functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to bind.

    \n
  2. \n
  3. thisArg (*)

    The this binding of func.

    \n
  4. \n
  5. [partials] (...*)

    The arguments to be partially applied.

    \n
  6. \n
\n

返回值 (Function)

\n

Returns the new bound function.

\n
\n

示例

\n
var greet = function(greeting, punctuation) {\n  return greeting + ' ' + this.user + punctuation;\n};\n\nvar object = { 'user': 'fred' };\n\nvar bound = _.bind(greet, object, 'hi');\nbound('!');\n// => 'hi fred!'\n\n// using placeholders\nvar bound = _.bind(greet, object, _, '!');\nbound('hi');\n// => 'hi fred!'\n
\n
\n
" } + "html":"

bind source npm

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

Creates a function that invokes func with the this binding of thisArg\nand prepends any additional _.bind arguments to those provided to the\nbound function.\n
\n
\nThe _.bind.placeholder value, which defaults to _ in monolithic builds,\nmay be used as a placeholder for partially applied arguments.\n
\n
\nNote: Unlike native Function#bind this method doesn't set the "length"\nproperty of bound functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to bind.

    \n
  2. \n
  3. thisArg (*)

    The this binding of func.

    \n
  4. \n
  5. [partials] (...*)

    The arguments to be partially applied.

    \n
  6. \n
\n

返回值 (Function)

\n

Returns the new bound function.

\n
\n

示例

\n
var greet = function(greeting, punctuation) {\n  return greeting + ' ' + this.user + punctuation;\n};\n\nvar object = { 'user': 'fred' };\n\nvar bound = _.bind(greet, object, 'hi');\nbound('!');\n// => 'hi fred!'\n\n// using placeholders\nvar bound = _.bind(greet, object, _, '!');\nbound('hi');\n// => 'hi fred!'\n
\n
\n
" } ,{ "href":"/bindKey", - "html":"

bindKey source npm

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

Creates a function that invokes the method at object[key] and prepends\nany additional _.bindKey arguments to those provided to the bound function.\n
\n
\nThis method differs from _.bind by allowing bound functions to reference\nmethods that may be redefined or don't yet exist.\nSee Peter Michaux's article\nfor more details.\n
\n
\nThe _.bindKey.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for partially applied arguments.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to invoke the method on.

    \n
  2. \n
  3. key (string)

    The key of the method.

    \n
  4. \n
  5. [partials] (...*)

    The arguments to be partially applied.

    \n
  6. \n
\n

返回值 (Function)

\n

Returns the new bound function.

\n
\n

示例

\n
var object = {\n  'user': 'fred',\n  'greet': function(greeting, punctuation) {\n    return greeting + ' ' + this.user + punctuation;\n  }\n};\n\nvar bound = _.bindKey(object, 'greet', 'hi');\nbound('!');\n// => 'hi fred!'\n\nobject.greet = function(greeting, punctuation) {\n  return greeting + 'ya ' + this.user + punctuation;\n};\n\nbound('!');\n// => 'hiya fred!'\n\n// using placeholders\nvar bound = _.bindKey(object, 'greet', _, '!');\nbound('hi');\n// => 'hiya fred!'\n
\n
\n
" } + "html":"

bindKey source npm

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

Creates a function that invokes the method at object[key] and prepends\nany additional _.bindKey arguments to those provided to the bound function.\n
\n
\nThis method differs from _.bind by allowing bound functions to reference\nmethods that may be redefined or don't yet exist.\nSee Peter Michaux's article\nfor more details.\n
\n
\nThe _.bindKey.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for partially applied arguments.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to invoke the method on.

    \n
  2. \n
  3. key (string)

    The key of the method.

    \n
  4. \n
  5. [partials] (...*)

    The arguments to be partially applied.

    \n
  6. \n
\n

返回值 (Function)

\n

Returns the new bound function.

\n
\n

示例

\n
var object = {\n  'user': 'fred',\n  'greet': function(greeting, punctuation) {\n    return greeting + ' ' + this.user + punctuation;\n  }\n};\n\nvar bound = _.bindKey(object, 'greet', 'hi');\nbound('!');\n// => 'hi fred!'\n\nobject.greet = function(greeting, punctuation) {\n  return greeting + 'ya ' + this.user + punctuation;\n};\n\nbound('!');\n// => 'hiya fred!'\n\n// using placeholders\nvar bound = _.bindKey(object, 'greet', _, '!');\nbound('hi');\n// => 'hiya fred!'\n
\n
\n
" } ,{ "href":"/curry", - "html":"

curry source npm

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

Creates a function that accepts arguments of func and either invokes\nfunc returning its result, if at least arity number of arguments have\nbeen provided, or returns a function that accepts the remaining func\narguments, and so on. The arity of func may be specified if func.length\nis not sufficient.\n
\n
\nThe _.curry.placeholder value, which defaults to _ in monolithic builds,\nmay be used as a placeholder for provided arguments.\n
\n
\nNote: This method doesn't set the "length" property of curried functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to curry.

    \n
  2. \n
  3. [arity=func.length] (number)

    The arity of func.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new curried function.

\n
\n

示例

\n
var abc = function(a, b, c) {\n  return [a, b, c];\n};\n\nvar curried = _.curry(abc);\n\ncurried(1)(2)(3);\n// => [1, 2, 3]\n\ncurried(1, 2)(3);\n// => [1, 2, 3]\n\ncurried(1, 2, 3);\n// => [1, 2, 3]\n\n// using placeholders\ncurried(1)(_, 3)(2);\n// => [1, 2, 3]\n
\n
\n
" } + "html":"

curry source npm

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

Creates a function that accepts arguments of func and either invokes\nfunc returning its result, if at least arity number of arguments have\nbeen provided, or returns a function that accepts the remaining func\narguments, and so on. The arity of func may be specified if func.length\nis not sufficient.\n
\n
\nThe _.curry.placeholder value, which defaults to _ in monolithic builds,\nmay be used as a placeholder for provided arguments.\n
\n
\nNote: This method doesn't set the "length" property of curried functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to curry.

    \n
  2. \n
  3. [arity=func.length] (number)

    The arity of func.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new curried function.

\n
\n

示例

\n
var abc = function(a, b, c) {\n  return [a, b, c];\n};\n\nvar curried = _.curry(abc);\n\ncurried(1)(2)(3);\n// => [1, 2, 3]\n\ncurried(1, 2)(3);\n// => [1, 2, 3]\n\ncurried(1, 2, 3);\n// => [1, 2, 3]\n\n// using placeholders\ncurried(1)(_, 3)(2);\n// => [1, 2, 3]\n
\n
\n
" } ,{ "href":"/curryRight", - "html":"

curryRight source npm

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

This method is like _.curry except that arguments are applied to func\nin the manner of _.partialRight instead of _.partial.\n
\n
\nThe _.curryRight.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for provided arguments.\n
\n
\nNote: This method doesn't set the "length" property of curried functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to curry.

    \n
  2. \n
  3. [arity=func.length] (number)

    The arity of func.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new curried function.

\n
\n

示例

\n
var abc = function(a, b, c) {\n  return [a, b, c];\n};\n\nvar curried = _.curryRight(abc);\n\ncurried(3)(2)(1);\n// => [1, 2, 3]\n\ncurried(2, 3)(1);\n// => [1, 2, 3]\n\ncurried(1, 2, 3);\n// => [1, 2, 3]\n\n// using placeholders\ncurried(3)(1, _)(2);\n// => [1, 2, 3]\n
\n
\n
" } + "html":"

curryRight source npm

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

This method is like _.curry except that arguments are applied to func\nin the manner of _.partialRight instead of _.partial.\n
\n
\nThe _.curryRight.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for provided arguments.\n
\n
\nNote: This method doesn't set the "length" property of curried functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to curry.

    \n
  2. \n
  3. [arity=func.length] (number)

    The arity of func.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new curried function.

\n
\n

示例

\n
var abc = function(a, b, c) {\n  return [a, b, c];\n};\n\nvar curried = _.curryRight(abc);\n\ncurried(3)(2)(1);\n// => [1, 2, 3]\n\ncurried(2, 3)(1);\n// => [1, 2, 3]\n\ncurried(1, 2, 3);\n// => [1, 2, 3]\n\n// using placeholders\ncurried(3)(1, _)(2);\n// => [1, 2, 3]\n
\n
\n
" } ,{ "href":"/debounce", - "html":"

debounce source npm

\n
_.debounce(func, [wait=0], [options])
\n\n

Creates a debounced function that delays invoking func until after wait\nmilliseconds have elapsed since the last time the debounced function was\ninvoked. The debounced function comes with a cancel method to cancel\ndelayed func invocations and a flush method to immediately invoke them.\nProvide an options object to indicate whether func should be invoked on\nthe leading and/or trailing edge of the wait timeout. The func is invoked\nwith the last arguments provided to the debounced function. Subsequent calls\nto the debounced function return the result of the last func invocation.\n
\n
\nNote: If leading and trailing options are true, func is invoked\non the trailing edge of the timeout only if the the debounced function is\ninvoked more than once during the wait timeout.\n
\n
\nSee David Corbacho's article\nfor details over the differences between _.debounce and _.throttle.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to debounce.

    \n
  2. \n
  3. [wait=0] (number)

    The number of milliseconds to delay.

    \n
  4. \n
  5. [options] (Object)

    The options object.

    \n
  6. \n
  7. [options.leading=false] (boolean)

    Specify invoking on the leading edge of the timeout.

    \n
  8. \n
  9. [options.maxWait] (number)

    The maximum time func is allowed to be delayed before it's invoked.

    \n
  10. \n
  11. [options.trailing=true] (boolean)

    Specify invoking on the trailing edge of the timeout.

    \n
  12. \n
\n

返回值 (Function)

\n

Returns the new debounced function.

\n
\n

示例

\n
// avoid costly calculations while the window size is in flux\njQuery(window).on('resize', _.debounce(calculateLayout, 150));\n\n// invoke `sendMail` when clicked, debouncing subsequent calls\njQuery(element).on('click', _.debounce(sendMail, 300, {\n  'leading': true,\n  'trailing': false\n}));\n\n// ensure `batchLog` is invoked once after 1 second of debounced calls\nvar debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\nvar source = new EventSource('/stream');\njQuery(source).on('message', debounced);\n\n// cancel a trailing debounced invocation\njQuery(window).on('popstate', debounced.cancel);\n
\n
\n
" } + "html":"

debounce source npm

\n
_.debounce(func, [wait=0], [options])
\n\n

Creates a debounced function that delays invoking func until after wait\nmilliseconds have elapsed since the last time the debounced function was\ninvoked. The debounced function comes with a cancel method to cancel\ndelayed func invocations and a flush method to immediately invoke them.\nProvide an options object to indicate whether func should be invoked on\nthe leading and/or trailing edge of the wait timeout. The func is invoked\nwith the last arguments provided to the debounced function. Subsequent calls\nto the debounced function return the result of the last func invocation.\n
\n
\nNote: If leading and trailing options are true, func is invoked\non the trailing edge of the timeout only if the the debounced function is\ninvoked more than once during the wait timeout.\n
\n
\nSee David Corbacho's article\nfor details over the differences between _.debounce and _.throttle.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to debounce.

    \n
  2. \n
  3. [wait=0] (number)

    The number of milliseconds to delay.

    \n
  4. \n
  5. [options] (Object)

    The options object.

    \n
  6. \n
  7. [options.leading=false] (boolean)

    Specify invoking on the leading edge of the timeout.

    \n
  8. \n
  9. [options.maxWait] (number)

    The maximum time func is allowed to be delayed before it's invoked.

    \n
  10. \n
  11. [options.trailing=true] (boolean)

    Specify invoking on the trailing edge of the timeout.

    \n
  12. \n
\n

返回值 (Function)

\n

Returns the new debounced function.

\n
\n

示例

\n
// avoid costly calculations while the window size is in flux\njQuery(window).on('resize', _.debounce(calculateLayout, 150));\n\n// invoke `sendMail` when clicked, debouncing subsequent calls\njQuery(element).on('click', _.debounce(sendMail, 300, {\n  'leading': true,\n  'trailing': false\n}));\n\n// ensure `batchLog` is invoked once after 1 second of debounced calls\nvar debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\nvar source = new EventSource('/stream');\njQuery(source).on('message', debounced);\n\n// cancel a trailing debounced invocation\njQuery(window).on('popstate', debounced.cancel);\n
\n
\n
" } ,{ "href":"/defer", - "html":"

defer source npm

\n
_.defer(func, [args])
\n\n

Defers invoking the func until the current call stack has cleared. Any\nadditional arguments are provided to func when it's invoked.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to defer.

    \n
  2. \n
  3. [args] (...*)

    The arguments to invoke func with.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the timer id.

\n
\n

示例

\n
_.defer(function(text) {\n  console.log(text);\n}, 'deferred');\n// logs 'deferred' after one or more milliseconds\n
\n
\n
" } + "html":"

defer source npm

\n
_.defer(func, [args])
\n\n

Defers invoking the func until the current call stack has cleared. Any\nadditional arguments are provided to func when it's invoked.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to defer.

    \n
  2. \n
  3. [args] (...*)

    The arguments to invoke func with.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the timer id.

\n
\n

示例

\n
_.defer(function(text) {\n  console.log(text);\n}, 'deferred');\n// logs 'deferred' after one or more milliseconds\n
\n
\n
" } ,{ "href":"/delay", - "html":"

delay source npm

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

Invokes func after wait milliseconds. Any additional arguments are\nprovided to func when it's invoked.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to delay.

    \n
  2. \n
  3. wait (number)

    The number of milliseconds to delay invocation.

    \n
  4. \n
  5. [args] (...*)

    The arguments to invoke func with.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the timer id.

\n
\n

示例

\n
_.delay(function(text) {\n  console.log(text);\n}, 1000, 'later');\n// => logs 'later' after one second\n
\n
\n
" } + "html":"

delay source npm

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

Invokes func after wait milliseconds. Any additional arguments are\nprovided to func when it's invoked.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to delay.

    \n
  2. \n
  3. wait (number)

    The number of milliseconds to delay invocation.

    \n
  4. \n
  5. [args] (...*)

    The arguments to invoke func with.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the timer id.

\n
\n

示例

\n
_.delay(function(text) {\n  console.log(text);\n}, 1000, 'later');\n// => logs 'later' after one second\n
\n
\n
" } ,{ "href":"/flip", - "html":"

flip source npm

\n
_.flip(func)
\n\n

Creates a function that invokes func with arguments reversed.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to flip arguments for.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var flipped = _.flip(function() {\n  return _.toArray(arguments);\n});\n\nflipped('a', 'b', 'c', 'd');\n// => ['d', 'c', 'b', 'a']\n
\n
\n
" } + "html":"

flip source npm

\n
_.flip(func)
\n\n

Creates a function that invokes func with arguments reversed.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to flip arguments for.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var flipped = _.flip(function() {\n  return _.toArray(arguments);\n});\n\nflipped('a', 'b', 'c', 'd');\n// => ['d', 'c', 'b', 'a']\n
\n
\n
" } ,{ "href":"/memoize", - "html":"

memoize source npm

\n
_.memoize(func, [resolver])
\n\n

Creates a function that memoizes the result of func. If resolver is\nprovided it determines the cache key for storing the result based on the\narguments provided to the memoized function. By default, the first argument\nprovided to the memoized function is used as the map cache key. The func\nis invoked with the this binding of the memoized function.\n
\n
\nNote: The cache is exposed as the cache property on the memoized\nfunction. Its creation may be customized by replacing the _.memoize.Cache\nconstructor with one whose instances implement the Map\nmethod interface of delete, get, has, and set.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to have its output memoized.

    \n
  2. \n
  3. [resolver] (Function)

    The function to resolve the cache key.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new memoizing function.

\n
\n

示例

\n
var object = { 'a': 1, 'b': 2 };\nvar other = { 'c': 3, 'd': 4 };\n\nvar values = _.memoize(_.values);\nvalues(object);\n// => [1, 2]\n\nvalues(other);\n// => [3, 4]\n\nobject.a = 2;\nvalues(object);\n// => [1, 2]\n\n// modifying the result cache\nvalues.cache.set(object, ['a', 'b']);\nvalues(object);\n// => ['a', 'b']\n\n// replacing `_.memoize.Cache`\n_.memoize.Cache = WeakMap;\n
\n
\n
" } + "html":"

memoize source npm

\n
_.memoize(func, [resolver])
\n\n

Creates a function that memoizes the result of func. If resolver is\nprovided it determines the cache key for storing the result based on the\narguments provided to the memoized function. By default, the first argument\nprovided to the memoized function is used as the map cache key. The func\nis invoked with the this binding of the memoized function.\n
\n
\nNote: The cache is exposed as the cache property on the memoized\nfunction. Its creation may be customized by replacing the _.memoize.Cache\nconstructor with one whose instances implement the Map\nmethod interface of delete, get, has, and set.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to have its output memoized.

    \n
  2. \n
  3. [resolver] (Function)

    The function to resolve the cache key.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new memoizing function.

\n
\n

示例

\n
var object = { 'a': 1, 'b': 2 };\nvar other = { 'c': 3, 'd': 4 };\n\nvar values = _.memoize(_.values);\nvalues(object);\n// => [1, 2]\n\nvalues(other);\n// => [3, 4]\n\nobject.a = 2;\nvalues(object);\n// => [1, 2]\n\n// modifying the result cache\nvalues.cache.set(object, ['a', 'b']);\nvalues(object);\n// => ['a', 'b']\n\n// replacing `_.memoize.Cache`\n_.memoize.Cache = WeakMap;\n
\n
\n
" } ,{ "href":"/negate", - "html":"

negate source npm

\n
_.negate(predicate)
\n\n

Creates a function that negates the result of the predicate func. The\nfunc predicate is invoked with the this binding and arguments of the\ncreated function.

\n
\n\n

参数

\n
    \n
  1. predicate (Function)

    The predicate to negate.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function isEven(n) {\n  return n % 2 == 0;\n}\n\n_.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n// => [1, 3, 5]\n
\n
\n
" } + "html":"

negate source npm

\n
_.negate(predicate)
\n\n

Creates a function that negates the result of the predicate func. The\nfunc predicate is invoked with the this binding and arguments of the\ncreated function.

\n
\n\n

参数

\n
    \n
  1. predicate (Function)

    The predicate to negate.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function isEven(n) {\n  return n % 2 == 0;\n}\n\n_.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n// => [1, 3, 5]\n
\n
\n
" } ,{ "href":"/once", - "html":"

once source npm

\n
_.once(func)
\n\n

Creates a function that is restricted to invoking func once. Repeat calls\nto the function return the value of the first invocation. The func is\ninvoked with the this binding and arguments of the created function.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to restrict.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new restricted function.

\n
\n

示例

\n
var initialize = _.once(createApplication);\ninitialize();\ninitialize();\n// `initialize` invokes `createApplication` once\n
\n
\n
" } + "html":"

once source npm

\n
_.once(func)
\n\n

Creates a function that is restricted to invoking func once. Repeat calls\nto the function return the value of the first invocation. The func is\ninvoked with the this binding and arguments of the created function.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to restrict.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new restricted function.

\n
\n

示例

\n
var initialize = _.once(createApplication);\ninitialize();\ninitialize();\n// `initialize` invokes `createApplication` once\n
\n
\n
" } ,{ "href":"/overArgs", - "html":"

overArgs source npm

\n
_.overArgs(func, [transforms])
\n\n

Creates a function that invokes func with arguments transformed by\ncorresponding transforms.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to wrap.

    \n
  2. \n
  3. [transforms] (...(Function|Function[])

    The functions to transform arguments, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function doubled(n) {\n  return n * 2;\n}\n\nfunction square(n) {\n  return n * n;\n}\n\nvar func = _.overArgs(function(x, y) {\n  return [x, y];\n}, square, doubled);\n\nfunc(9, 3);\n// => [81, 6]\n\nfunc(10, 5);\n// => [100, 10]\n
\n
\n
" } + "html":"

overArgs source npm

\n
_.overArgs(func, [transforms])
\n\n

Creates a function that invokes func with arguments transformed by\ncorresponding transforms.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to wrap.

    \n
  2. \n
  3. [transforms] (...(Function|Function[])

    The functions to transform arguments, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function doubled(n) {\n  return n * 2;\n}\n\nfunction square(n) {\n  return n * n;\n}\n\nvar func = _.overArgs(function(x, y) {\n  return [x, y];\n}, square, doubled);\n\nfunc(9, 3);\n// => [81, 6]\n\nfunc(10, 5);\n// => [100, 10]\n
\n
\n
" } ,{ "href":"/partial", - "html":"

partial source npm

\n
_.partial(func, [partials])
\n\n

Creates a function that invokes func with partial arguments prepended\nto those provided to the new function. This method is like _.bind except\nit does not alter the this binding.\n
\n
\nThe _.partial.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for partially applied arguments.\n
\n
\nNote: This method doesn't set the "length" property of partially\napplied functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to partially apply arguments to.

    \n
  2. \n
  3. [partials] (...*)

    The arguments to be partially applied.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new partially applied function.

\n
\n

示例

\n
var greet = function(greeting, name) {\n  return greeting + ' ' + name;\n};\n\nvar sayHelloTo = _.partial(greet, 'hello');\nsayHelloTo('fred');\n// => 'hello fred'\n\n// using placeholders\nvar greetFred = _.partial(greet, _, 'fred');\ngreetFred('hi');\n// => 'hi fred'\n
\n
\n
" } + "html":"

partial source npm

\n
_.partial(func, [partials])
\n\n

Creates a function that invokes func with partial arguments prepended\nto those provided to the new function. This method is like _.bind except\nit does not alter the this binding.\n
\n
\nThe _.partial.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for partially applied arguments.\n
\n
\nNote: This method doesn't set the "length" property of partially\napplied functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to partially apply arguments to.

    \n
  2. \n
  3. [partials] (...*)

    The arguments to be partially applied.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new partially applied function.

\n
\n

示例

\n
var greet = function(greeting, name) {\n  return greeting + ' ' + name;\n};\n\nvar sayHelloTo = _.partial(greet, 'hello');\nsayHelloTo('fred');\n// => 'hello fred'\n\n// using placeholders\nvar greetFred = _.partial(greet, _, 'fred');\ngreetFred('hi');\n// => 'hi fred'\n
\n
\n
" } ,{ "href":"/partialRight", - "html":"

partialRight source npm

\n
_.partialRight(func, [partials])
\n\n

This method is like _.partial except that partially applied arguments\nare appended to those provided to the new function.\n
\n
\nThe _.partialRight.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for partially applied arguments.\n
\n
\nNote: This method doesn't set the "length" property of partially\napplied functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to partially apply arguments to.

    \n
  2. \n
  3. [partials] (...*)

    The arguments to be partially applied.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new partially applied function.

\n
\n

示例

\n
var greet = function(greeting, name) {\n  return greeting + ' ' + name;\n};\n\nvar greetFred = _.partialRight(greet, 'fred');\ngreetFred('hi');\n// => 'hi fred'\n\n// using placeholders\nvar sayHelloTo = _.partialRight(greet, 'hello', _);\nsayHelloTo('fred');\n// => 'hello fred'\n
\n
\n
" } + "html":"

partialRight source npm

\n
_.partialRight(func, [partials])
\n\n

This method is like _.partial except that partially applied arguments\nare appended to those provided to the new function.\n
\n
\nThe _.partialRight.placeholder value, which defaults to _ in monolithic\nbuilds, may be used as a placeholder for partially applied arguments.\n
\n
\nNote: This method doesn't set the "length" property of partially\napplied functions.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to partially apply arguments to.

    \n
  2. \n
  3. [partials] (...*)

    The arguments to be partially applied.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new partially applied function.

\n
\n

示例

\n
var greet = function(greeting, name) {\n  return greeting + ' ' + name;\n};\n\nvar greetFred = _.partialRight(greet, 'fred');\ngreetFred('hi');\n// => 'hi fred'\n\n// using placeholders\nvar sayHelloTo = _.partialRight(greet, 'hello', _);\nsayHelloTo('fred');\n// => 'hello fred'\n
\n
\n
" } ,{ "href":"/rearg", - "html":"

rearg source npm

\n
_.rearg(func, indexes)
\n\n

Creates a function that invokes func with arguments arranged according\nto the specified indexes where the argument value at the first index is\nprovided as the first argument, the argument value at the second index is\nprovided as the second argument, and so on.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to rearrange arguments for.

    \n
  2. \n
  3. indexes (...(number|number[])

    The arranged argument indexes, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var rearged = _.rearg(function(a, b, c) {\n  return [a, b, c];\n}, 2, 0, 1);\n\nrearged('b', 'c', 'a')\n// => ['a', 'b', 'c']\n
\n
\n
" } + "html":"

rearg source npm

\n
_.rearg(func, indexes)
\n\n

Creates a function that invokes func with arguments arranged according\nto the specified indexes where the argument value at the first index is\nprovided as the first argument, the argument value at the second index is\nprovided as the second argument, and so on.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to rearrange arguments for.

    \n
  2. \n
  3. indexes (...(number|number[])

    The arranged argument indexes, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var rearged = _.rearg(function(a, b, c) {\n  return [a, b, c];\n}, 2, 0, 1);\n\nrearged('b', 'c', 'a')\n// => ['a', 'b', 'c']\n
\n
\n
" } ,{ "href":"/rest", - "html":"

rest source npm

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

Creates a function that invokes func with the this binding of the\ncreated function and arguments from start and beyond provided as an array.\n
\n
\nNote: This method is based on the rest parameter.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to apply a rest parameter to.

    \n
  2. \n
  3. [start=func.length-1] (number)

    The start position of the rest parameter.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var say = _.rest(function(what, names) {\n  return what + ' ' + _.initial(names).join(', ') +\n    (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n});\n\nsay('hello', 'fred', 'barney', 'pebbles');\n// => 'hello fred, barney, & pebbles'\n
\n
\n
" } + "html":"

rest source npm

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

Creates a function that invokes func with the this binding of the\ncreated function and arguments from start and beyond provided as an array.\n
\n
\nNote: This method is based on the rest parameter.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to apply a rest parameter to.

    \n
  2. \n
  3. [start=func.length-1] (number)

    The start position of the rest parameter.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var say = _.rest(function(what, names) {\n  return what + ' ' + _.initial(names).join(', ') +\n    (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n});\n\nsay('hello', 'fred', 'barney', 'pebbles');\n// => 'hello fred, barney, & pebbles'\n
\n
\n
" } ,{ "href":"/spread", - "html":"

spread source npm

\n
_.spread(func)
\n\n

Creates a function that invokes func with the this binding of the created\nfunction and an array of arguments much like Function#apply.\n
\n
\nNote: This method is based on the spread operator.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to spread arguments over.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var say = _.spread(function(who, what) {\n  return who + ' says ' + what;\n});\n\nsay(['fred', 'hello']);\n// => 'fred says hello'\n\n// with a Promise\nvar numbers = Promise.all([\n  Promise.resolve(40),\n  Promise.resolve(36)\n]);\n\nnumbers.then(_.spread(function(x, y) {\n  return x + y;\n}));\n// => a Promise of 76\n
\n
\n
" } + "html":"

spread source npm

\n
_.spread(func)
\n\n

Creates a function that invokes func with the this binding of the created\nfunction and an array of arguments much like Function#apply.\n
\n
\nNote: This method is based on the spread operator.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to spread arguments over.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var say = _.spread(function(who, what) {\n  return who + ' says ' + what;\n});\n\nsay(['fred', 'hello']);\n// => 'fred says hello'\n\n// with a Promise\nvar numbers = Promise.all([\n  Promise.resolve(40),\n  Promise.resolve(36)\n]);\n\nnumbers.then(_.spread(function(x, y) {\n  return x + y;\n}));\n// => a Promise of 76\n
\n
\n
" } ,{ "href":"/throttle", - "html":"

throttle source npm

\n
_.throttle(func, [wait=0], [options])
\n\n

Creates a throttled function that only invokes func at most once per\nevery wait milliseconds. The throttled function comes with a cancel\nmethod to cancel delayed func invocations and a flush method to\nimmediately invoke them. Provide an options object to indicate whether\nfunc should be invoked on the leading and/or trailing edge of the wait\ntimeout. The func is invoked with the last arguments provided to the\nthrottled function. Subsequent calls to the throttled function return the\nresult of the last func invocation.\n
\n
\nNote: If leading and trailing options are true, func is invoked\non the trailing edge of the timeout only if the the throttled function is\ninvoked more than once during the wait timeout.\n
\n
\nSee David Corbacho's article\nfor details over the differences between _.throttle and _.debounce.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to throttle.

    \n
  2. \n
  3. [wait=0] (number)

    The number of milliseconds to throttle invocations to.

    \n
  4. \n
  5. [options] (Object)

    The options object.

    \n
  6. \n
  7. [options.leading=true] (boolean)

    Specify invoking on the leading edge of the timeout.

    \n
  8. \n
  9. [options.trailing=true] (boolean)

    Specify invoking on the trailing edge of the timeout.

    \n
  10. \n
\n

返回值 (Function)

\n

Returns the new throttled function.

\n
\n

示例

\n
// avoid excessively updating the position while scrolling\njQuery(window).on('scroll', _.throttle(updatePosition, 100));\n\n// invoke `renewToken` when the click event is fired, but not more than once every 5 minutes\nvar throttled = _.throttle(renewToken, 300000, { 'trailing': false });\njQuery(element).on('click', throttled);\n\n// cancel a trailing throttled invocation\njQuery(window).on('popstate', throttled.cancel);\n
\n
\n
" } + "html":"

throttle source npm

\n
_.throttle(func, [wait=0], [options])
\n\n

Creates a throttled function that only invokes func at most once per\nevery wait milliseconds. The throttled function comes with a cancel\nmethod to cancel delayed func invocations and a flush method to\nimmediately invoke them. Provide an options object to indicate whether\nfunc should be invoked on the leading and/or trailing edge of the wait\ntimeout. The func is invoked with the last arguments provided to the\nthrottled function. Subsequent calls to the throttled function return the\nresult of the last func invocation.\n
\n
\nNote: If leading and trailing options are true, func is invoked\non the trailing edge of the timeout only if the the throttled function is\ninvoked more than once during the wait timeout.\n
\n
\nSee David Corbacho's article\nfor details over the differences between _.throttle and _.debounce.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to throttle.

    \n
  2. \n
  3. [wait=0] (number)

    The number of milliseconds to throttle invocations to.

    \n
  4. \n
  5. [options] (Object)

    The options object.

    \n
  6. \n
  7. [options.leading=true] (boolean)

    Specify invoking on the leading edge of the timeout.

    \n
  8. \n
  9. [options.trailing=true] (boolean)

    Specify invoking on the trailing edge of the timeout.

    \n
  10. \n
\n

返回值 (Function)

\n

Returns the new throttled function.

\n
\n

示例

\n
// avoid excessively updating the position while scrolling\njQuery(window).on('scroll', _.throttle(updatePosition, 100));\n\n// invoke `renewToken` when the click event is fired, but not more than once every 5 minutes\nvar throttled = _.throttle(renewToken, 300000, { 'trailing': false });\njQuery(element).on('click', throttled);\n\n// cancel a trailing throttled invocation\njQuery(window).on('popstate', throttled.cancel);\n
\n
\n
" } ,{ "href":"/unary", - "html":"

unary source npm

\n
_.unary(func)
\n\n

Creates a function that accepts up to one argument, ignoring any\nadditional arguments.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to cap arguments for.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
_.map(['6', '8', '10'], _.unary(parseInt));\n// => [6, 8, 10]\n
\n
\n
" } + "html":"

unary source npm

\n
_.unary(func)
\n\n

Creates a function that accepts up to one argument, ignoring any\nadditional arguments.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to cap arguments for.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
_.map(['6', '8', '10'], _.unary(parseInt));\n// => [6, 8, 10]\n
\n
\n
" } ,{ "href":"/wrap", - "html":"

wrap source npm

\n
_.wrap(value, wrapper)
\n\n

Creates a function that provides value to the wrapper function as its\nfirst argument. Any additional arguments provided to the function are\nappended to those provided to the wrapper function. The wrapper is invoked\nwith the this binding of the created function.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to wrap.

    \n
  2. \n
  3. wrapper (Function)

    The wrapper function.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var p = _.wrap(_.escape, function(func, text) {\n  return '<p>' + func(text) + '</p>';\n});\n\np('fred, barney, & pebbles');\n// => '<p>fred, barney, &amp; pebbles</p>'\n
\n
\n
" } + "html":"

wrap source npm

\n
_.wrap(value, wrapper)
\n\n

Creates a function that provides value to the wrapper function as its\nfirst argument. Any additional arguments provided to the function are\nappended to those provided to the wrapper function. The wrapper is invoked\nwith the this binding of the created function.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to wrap.

    \n
  2. \n
  3. wrapper (Function)

    The wrapper function.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var p = _.wrap(_.escape, function(func, text) {\n  return '<p>' + func(text) + '</p>';\n});\n\np('fred, barney, & pebbles');\n// => '<p>fred, barney, &amp; pebbles</p>'\n
\n
\n
" } ,{ "href":"/clone", - "html":"

clone source npm

\n
_.clone(value)
\n\n

Creates a shallow clone of value.\n
\n
\nNote: This method is loosely based on the\nstructured clone algorithm\nand supports cloning arrays, array buffers, booleans, date objects, maps,\nnumbers, Object objects, regexes, sets, strings, symbols, and typed arrays.\nThe own enumerable properties of arguments objects and objects created\nby constructors other than Object are cloned as plain Object objects.\nAn empty object is returned for uncloneable values such as error objects,\nfunctions, DOM nodes, and WeakMaps.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to clone.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the cloned value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\nvar shallow = _.clone(users);\nconsole.log(shallow[0] === users[0]);\n// => true\n
\n
\n
" } + "html":"

clone source npm

\n
_.clone(value)
\n\n

Creates a shallow clone of value.\n
\n
\nNote: This method is loosely based on the\nstructured clone algorithm\nand supports cloning arrays, array buffers, booleans, date objects, maps,\nnumbers, Object objects, regexes, sets, strings, symbols, and typed\narrays. The own enumerable properties of arguments objects are cloned\nas plain objects. An empty object is returned for uncloneable values such\nas error objects, functions, DOM nodes, and WeakMaps.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to clone.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the cloned value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\nvar shallow = _.clone(users);\nconsole.log(shallow[0] === users[0]);\n// => true\n
\n
\n
" } ,{ "href":"/cloneDeep", - "html":"

cloneDeep source npm

\n
_.cloneDeep(value)
\n\n

This method is like _.clone except that it recursively clones value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to recursively clone.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the deep cloned value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\nvar deep = _.cloneDeep(users);\nconsole.log(deep[0] === users[0]);\n// => false\n
\n
\n
" } + "html":"

cloneDeep source npm

\n
_.cloneDeep(value)
\n\n

This method is like _.clone except that it recursively clones value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to recursively clone.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the deep cloned value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\nvar deep = _.cloneDeep(users);\nconsole.log(deep[0] === users[0]);\n// => false\n
\n
\n
" } ,{ "href":"/cloneDeepWith", - "html":"

cloneDeepWith source npm

\n
_.cloneDeepWith(value, [customizer])
\n\n

This method is like _.cloneWith except that it recursively clones value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to recursively clone.

    \n
  2. \n
  3. [customizer] (Function)

    The function to customize cloning.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the deep cloned value.

\n
\n

示例

\n
function customizer(value) {\n  if (_.isElement(value)) {\n    return value.cloneNode(true);\n  }\n}\n\nvar el = _.cloneDeep(document.body, customizer);\n\nconsole.log(el === document.body);\n// => false\nconsole.log(el.nodeName);\n// => BODY\nconsole.log(el.childNodes.length);\n// => 20\n
\n
\n
" } + "html":"

cloneDeepWith source npm

\n
_.cloneDeepWith(value, [customizer])
\n\n

This method is like _.cloneWith except that it recursively clones value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to recursively clone.

    \n
  2. \n
  3. [customizer] (Function)

    The function to customize cloning.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the deep cloned value.

\n
\n

示例

\n
function customizer(value) {\n  if (_.isElement(value)) {\n    return value.cloneNode(true);\n  }\n}\n\nvar el = _.cloneDeep(document.body, customizer);\n\nconsole.log(el === document.body);\n// => false\nconsole.log(el.nodeName);\n// => BODY\nconsole.log(el.childNodes.length);\n// => 20\n
\n
\n
" } ,{ "href":"/cloneWith", - "html":"

cloneWith source npm

\n
_.cloneWith(value, [customizer])
\n\n

This method is like _.clone except that it accepts customizer which\nis invoked to produce the cloned value. If customizer returns undefined\ncloning is handled by the method instead. The customizer is invoked with\nup to five arguments; (value [, index|key, object, stack]).

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to clone.

    \n
  2. \n
  3. [customizer] (Function)

    The function to customize cloning.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the cloned value.

\n
\n

示例

\n
function customizer(value) {\n  if (_.isElement(value)) {\n    return value.cloneNode(false);\n  }\n}\n\nvar el = _.clone(document.body, customizer);\n\nconsole.log(el === document.body);\n// => false\nconsole.log(el.nodeName);\n// => BODY\nconsole.log(el.childNodes.length);\n// => 0\n
\n
\n
" } + "html":"

cloneWith source npm

\n
_.cloneWith(value, [customizer])
\n\n

This method is like _.clone except that it accepts customizer which\nis invoked to produce the cloned value. If customizer returns undefined\ncloning is handled by the method instead. The customizer is invoked with\nup to five arguments; (value [, index|key, object, stack]).

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to clone.

    \n
  2. \n
  3. [customizer] (Function)

    The function to customize cloning.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the cloned value.

\n
\n

示例

\n
function customizer(value) {\n  if (_.isElement(value)) {\n    return value.cloneNode(false);\n  }\n}\n\nvar el = _.clone(document.body, customizer);\n\nconsole.log(el === document.body);\n// => false\nconsole.log(el.nodeName);\n// => BODY\nconsole.log(el.childNodes.length);\n// => 0\n
\n
\n
" } ,{ "href":"/eq", - "html":"

eq source npm

\n
_.eq(value, other)
\n\n

Performs a SameValueZero\ncomparison between two values to determine if they are equivalent.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if the values are equivalent, else false.

\n
\n

示例

\n
var object = { 'user': 'fred' };\nvar other = { 'user': 'fred' };\n\n_.eq(object, object);\n// => true\n\n_.eq(object, other);\n// => false\n\n_.eq('a', 'a');\n// => true\n\n_.eq('a', Object('a'));\n// => false\n\n_.eq(NaN, NaN);\n// => true\n
\n
\n
" } + "html":"

eq source npm

\n
_.eq(value, other)
\n\n

Performs a SameValueZero\ncomparison between two values to determine if they are equivalent.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if the values are equivalent, else false.

\n
\n

示例

\n
var object = { 'user': 'fred' };\nvar other = { 'user': 'fred' };\n\n_.eq(object, object);\n// => true\n\n_.eq(object, other);\n// => false\n\n_.eq('a', 'a');\n// => true\n\n_.eq('a', Object('a'));\n// => false\n\n_.eq(NaN, NaN);\n// => true\n
\n
\n
" } ,{ "href":"/gt", - "html":"

gt source npm

\n
_.gt(value, other)
\n\n

Checks if value is greater than other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is greater than other, else false.

\n
\n

示例

\n
_.gt(3, 1);\n// => true\n\n_.gt(3, 3);\n// => false\n\n_.gt(1, 3);\n// => false\n
\n
\n
" } + "html":"

gt source npm

\n
_.gt(value, other)
\n\n

Checks if value is greater than other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is greater than other, else false.

\n
\n

示例

\n
_.gt(3, 1);\n// => true\n\n_.gt(3, 3);\n// => false\n\n_.gt(1, 3);\n// => false\n
\n
\n
" } ,{ "href":"/gte", - "html":"

gte source npm

\n
_.gte(value, other)
\n\n

Checks if value is greater than or equal to other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is greater than or equal to other, else false.

\n
\n

示例

\n
_.gte(3, 1);\n// => true\n\n_.gte(3, 3);\n// => true\n\n_.gte(1, 3);\n// => false\n
\n
\n
" } + "html":"

gte source npm

\n
_.gte(value, other)
\n\n

Checks if value is greater than or equal to other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is greater than or equal to other, else false.

\n
\n

示例

\n
_.gte(3, 1);\n// => true\n\n_.gte(3, 3);\n// => true\n\n_.gte(1, 3);\n// => false\n
\n
\n
" } ,{ "href":"/isArguments", - "html":"

isArguments source npm

\n
_.isArguments(value)
\n\n

Checks if value is likely an arguments object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isArguments(function() { return arguments; }());\n// => true\n\n_.isArguments([1, 2, 3]);\n// => false\n
\n
\n
" } + "html":"

isArguments source npm

\n
_.isArguments(value)
\n\n

Checks if value is likely an arguments object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isArguments(function() { return arguments; }());\n// => true\n\n_.isArguments([1, 2, 3]);\n// => false\n
\n
\n
" } ,{ "href":"/isArray", - "html":"

isArray source npm

\n
_.isArray(value)
\n\n

Checks if value is classified as an Array object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isArray([1, 2, 3]);\n// => true\n\n_.isArray(document.body.children);\n// => false\n\n_.isArray('abc');\n// => false\n\n_.isArray(_.noop);\n// => false\n
\n
\n
" } + "html":"

isArray source npm

\n
_.isArray(value)
\n\n

Checks if value is classified as an Array object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isArray([1, 2, 3]);\n// => true\n\n_.isArray(document.body.children);\n// => false\n\n_.isArray('abc');\n// => false\n\n_.isArray(_.noop);\n// => false\n
\n
\n
" } ,{ "href":"/isArrayLike", - "html":"

isArrayLike source npm

\n
_.isArrayLike(value)
\n\n

Checks if value is array-like. A value is considered array-like if it's\nnot a function and has a value.length that's an integer greater than or\nequal to 0 and less than or equal to Number.MAX_SAFE_INTEGER.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is array-like, else false.

\n
\n

示例

\n
_.isArrayLike([1, 2, 3]);\n// => true\n\n_.isArrayLike(document.body.children);\n// => true\n\n_.isArrayLike('abc');\n// => true\n\n_.isArrayLike(_.noop);\n// => false\n
\n
\n
" } + "html":"

isArrayLike source npm

\n
_.isArrayLike(value)
\n\n

Checks if value is array-like. A value is considered array-like if it's\nnot a function and has a value.length that's an integer greater than or\nequal to 0 and less than or equal to Number.MAX_SAFE_INTEGER.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is array-like, else false.

\n
\n

示例

\n
_.isArrayLike([1, 2, 3]);\n// => true\n\n_.isArrayLike(document.body.children);\n// => true\n\n_.isArrayLike('abc');\n// => true\n\n_.isArrayLike(_.noop);\n// => false\n
\n
\n
" } ,{ "href":"/isArrayLikeObject", - "html":"

isArrayLikeObject source npm

\n
_.isArrayLikeObject(value)
\n\n

This method is like _.isArrayLike except that it also checks if value\nis an object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an array-like object, else false.

\n
\n

示例

\n
_.isArrayLikeObject([1, 2, 3]);\n// => true\n\n_.isArrayLikeObject(document.body.children);\n// => true\n\n_.isArrayLikeObject('abc');\n// => false\n\n_.isArrayLikeObject(_.noop);\n// => false\n
\n
\n
" } + "html":"

isArrayLikeObject source npm

\n
_.isArrayLikeObject(value)
\n\n

This method is like _.isArrayLike except that it also checks if value\nis an object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an array-like object, else false.

\n
\n

示例

\n
_.isArrayLikeObject([1, 2, 3]);\n// => true\n\n_.isArrayLikeObject(document.body.children);\n// => true\n\n_.isArrayLikeObject('abc');\n// => false\n\n_.isArrayLikeObject(_.noop);\n// => false\n
\n
\n
" } ,{ "href":"/isBoolean", - "html":"

isBoolean source npm

\n
_.isBoolean(value)
\n\n

Checks if value is classified as a boolean primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isBoolean(false);\n// => true\n\n_.isBoolean(null);\n// => false\n
\n
\n
" } + "html":"

isBoolean source npm

\n
_.isBoolean(value)
\n\n

Checks if value is classified as a boolean primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isBoolean(false);\n// => true\n\n_.isBoolean(null);\n// => false\n
\n
\n
" } ,{ "href":"/isDate", - "html":"

isDate source npm

\n
_.isDate(value)
\n\n

Checks if value is classified as a Date object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isDate(new Date);\n// => true\n\n_.isDate('Mon April 23 2012');\n// => false\n
\n
\n
" } + "html":"

isDate source npm

\n
_.isDate(value)
\n\n

Checks if value is classified as a Date object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isDate(new Date);\n// => true\n\n_.isDate('Mon April 23 2012');\n// => false\n
\n
\n
" } ,{ "href":"/isElement", - "html":"

isElement source npm

\n
_.isElement(value)
\n\n

Checks if value is likely a DOM element.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a DOM element, else false.

\n
\n

示例

\n
_.isElement(document.body);\n// => true\n\n_.isElement('<body>');\n// => false\n
\n
\n
" } + "html":"

isElement source npm

\n
_.isElement(value)
\n\n

Checks if value is likely a DOM element.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a DOM element, else false.

\n
\n

示例

\n
_.isElement(document.body);\n// => true\n\n_.isElement('<body>');\n// => false\n
\n
\n
" } ,{ "href":"/isEmpty", - "html":"

isEmpty source npm

\n
_.isEmpty(value)
\n\n

Checks if value is empty. A value is considered empty unless it's an\narguments object, array, string, or jQuery-like collection with a length\ngreater than 0 or an object with own enumerable properties.

\n
\n\n

参数

\n
    \n
  1. value (Array|Object|string)

    The value to inspect.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is empty, else false.

\n
\n

示例

\n
_.isEmpty(null);\n// => true\n\n_.isEmpty(true);\n// => true\n\n_.isEmpty(1);\n// => true\n\n_.isEmpty([1, 2, 3]);\n// => false\n\n_.isEmpty({ 'a': 1 });\n// => false\n
\n
\n
" } + "html":"

isEmpty source npm

\n
_.isEmpty(value)
\n\n

Checks if value is empty. A value is considered empty unless it's an\narguments object, array, string, or jQuery-like collection with a length\ngreater than 0 or an object with own enumerable properties.

\n
\n\n

参数

\n
    \n
  1. value (Array|Object|string)

    The value to inspect.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is empty, else false.

\n
\n

示例

\n
_.isEmpty(null);\n// => true\n\n_.isEmpty(true);\n// => true\n\n_.isEmpty(1);\n// => true\n\n_.isEmpty([1, 2, 3]);\n// => false\n\n_.isEmpty({ 'a': 1 });\n// => false\n
\n
\n
" } ,{ "href":"/isEqual", - "html":"

isEqual source npm

\n
_.isEqual(value, other)
\n\n

Performs a deep comparison between two values to determine if they are\nequivalent.\n
\n
\nNote: This method supports comparing arrays, array buffers, booleans,\ndate objects, error objects, maps, numbers, Object objects, regexes,\nsets, strings, symbols, and typed arrays. Object objects are compared\nby their own, not inherited, enumerable properties. Functions and DOM\nnodes are not supported.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if the values are equivalent, else false.

\n
\n

示例

\n
var object = { 'user': 'fred' };\nvar other = { 'user': 'fred' };\n\n_.isEqual(object, other);\n// => true\n\nobject === other;\n// => false\n
\n
\n
" } + "html":"

isEqual source npm

\n
_.isEqual(value, other)
\n\n

Performs a deep comparison between two values to determine if they are\nequivalent.\n
\n
\nNote: This method supports comparing arrays, array buffers, booleans,\ndate objects, error objects, maps, numbers, Object objects, regexes,\nsets, strings, symbols, and typed arrays. Object objects are compared\nby their own, not inherited, enumerable properties. Functions and DOM\nnodes are not supported.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if the values are equivalent, else false.

\n
\n

示例

\n
var object = { 'user': 'fred' };\nvar other = { 'user': 'fred' };\n\n_.isEqual(object, other);\n// => true\n\nobject === other;\n// => false\n
\n
\n
" } ,{ "href":"/isEqualWith", - "html":"

isEqualWith source npm

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

This method is like _.isEqual except that it accepts customizer which is\ninvoked to compare values. If customizer returns undefined comparisons are\nhandled by the method instead. The customizer is invoked with up to seven arguments:
\n(objValue, othValue [, index|key, object, other, stack]).

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize comparisons.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if the values are equivalent, else false.

\n
\n

示例

\n
function isGreeting(value) {\n  return /^h(?:i|ello)$/.test(value);\n}\n\nfunction customizer(objValue, othValue) {\n  if (isGreeting(objValue) && isGreeting(othValue)) {\n    return true;\n  }\n}\n\nvar array = ['hello', 'goodbye'];\nvar other = ['hi', 'goodbye'];\n\n_.isEqualWith(array, other, customizer);\n// => true\n
\n
\n
" } + "html":"

isEqualWith source npm

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

This method is like _.isEqual except that it accepts customizer which is\ninvoked to compare values. If customizer returns undefined comparisons are\nhandled by the method instead. The customizer is invoked with up to seven arguments:
\n(objValue, othValue [, index|key, object, other, stack]).

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize comparisons.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if the values are equivalent, else false.

\n
\n

示例

\n
function isGreeting(value) {\n  return /^h(?:i|ello)$/.test(value);\n}\n\nfunction customizer(objValue, othValue) {\n  if (isGreeting(objValue) && isGreeting(othValue)) {\n    return true;\n  }\n}\n\nvar array = ['hello', 'goodbye'];\nvar other = ['hi', 'goodbye'];\n\n_.isEqualWith(array, other, customizer);\n// => true\n
\n
\n
" } ,{ "href":"/isError", - "html":"

isError source npm

\n
_.isError(value)
\n\n

Checks if value is an Error, EvalError, RangeError, ReferenceError,\nSyntaxError, TypeError, or URIError object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an error object, else false.

\n
\n

示例

\n
_.isError(new Error);\n// => true\n\n_.isError(Error);\n// => false\n
\n
\n
" } + "html":"

isError source npm

\n
_.isError(value)
\n\n

Checks if value is an Error, EvalError, RangeError, ReferenceError,\nSyntaxError, TypeError, or URIError object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an error object, else false.

\n
\n

示例

\n
_.isError(new Error);\n// => true\n\n_.isError(Error);\n// => false\n
\n
\n
" } ,{ "href":"/isFinite", - "html":"

isFinite source npm

\n
_.isFinite(value)
\n\n

Checks if value is a finite primitive number.\n
\n
\nNote: This method is based on Number.isFinite.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a finite number, else false.

\n
\n

示例

\n
_.isFinite(3);\n// => true\n\n_.isFinite(Number.MAX_VALUE);\n// => true\n\n_.isFinite(3.14);\n// => true\n\n_.isFinite(Infinity);\n// => false\n
\n
\n
" } + "html":"

isFinite source npm

\n
_.isFinite(value)
\n\n

Checks if value is a finite primitive number.\n
\n
\nNote: This method is based on Number.isFinite.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a finite number, else false.

\n
\n

示例

\n
_.isFinite(3);\n// => true\n\n_.isFinite(Number.MAX_VALUE);\n// => true\n\n_.isFinite(3.14);\n// => true\n\n_.isFinite(Infinity);\n// => false\n
\n
\n
" } ,{ "href":"/isFunction", - "html":"

isFunction source npm

\n
_.isFunction(value)
\n\n

Checks if value is classified as a Function object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isFunction(_);\n// => true\n\n_.isFunction(/abc/);\n// => false\n
\n
\n
" } + "html":"

isFunction source npm

\n
_.isFunction(value)
\n\n

Checks if value is classified as a Function object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isFunction(_);\n// => true\n\n_.isFunction(/abc/);\n// => false\n
\n
\n
" } ,{ "href":"/isInteger", - "html":"

isInteger source npm

\n
_.isInteger(value)
\n\n

Checks if value is an integer.\n
\n
\nNote: This method is based on Number.isInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an integer, else false.

\n
\n

示例

\n
_.isInteger(3);\n// => true\n\n_.isInteger(Number.MIN_VALUE);\n// => false\n\n_.isInteger(Infinity);\n// => false\n\n_.isInteger('3');\n// => false\n
\n
\n
" } + "html":"

isInteger source npm

\n
_.isInteger(value)
\n\n

Checks if value is an integer.\n
\n
\nNote: This method is based on Number.isInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an integer, else false.

\n
\n

示例

\n
_.isInteger(3);\n// => true\n\n_.isInteger(Number.MIN_VALUE);\n// => false\n\n_.isInteger(Infinity);\n// => false\n\n_.isInteger('3');\n// => false\n
\n
\n
" } ,{ "href":"/isLength", - "html":"

isLength source npm

\n
_.isLength(value)
\n\n

Checks if value is a valid array-like length.\n
\n
\nNote: This function is loosely based on ToLength.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a valid length, else false.

\n
\n

示例

\n
_.isLength(3);\n// => true\n\n_.isLength(Number.MIN_VALUE);\n// => false\n\n_.isLength(Infinity);\n// => false\n\n_.isLength('3');\n// => false\n
\n
\n
" } + "html":"

isLength source npm

\n
_.isLength(value)
\n\n

Checks if value is a valid array-like length.\n
\n
\nNote: This function is loosely based on ToLength.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a valid length, else false.

\n
\n

示例

\n
_.isLength(3);\n// => true\n\n_.isLength(Number.MIN_VALUE);\n// => false\n\n_.isLength(Infinity);\n// => false\n\n_.isLength('3');\n// => false\n
\n
\n
" } ,{ "href":"/isMatch", - "html":"

isMatch source npm

\n
_.isMatch(object, source)
\n\n

Performs a deep comparison between object and source to determine if\nobject contains equivalent property values.\n
\n
\nNote: This method supports comparing the same values as _.isEqual.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
  3. source (Object)

    The object of property values to match.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if object is a match, else false.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.isMatch(object, { 'age': 40 });\n// => true\n\n_.isMatch(object, { 'age': 36 });\n// => false\n
\n
\n
" } + "html":"

isMatch source npm

\n
_.isMatch(object, source)
\n\n

Performs a deep comparison between object and source to determine if\nobject contains equivalent property values.\n
\n
\nNote: This method supports comparing the same values as _.isEqual.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
  3. source (Object)

    The object of property values to match.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if object is a match, else false.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.isMatch(object, { 'age': 40 });\n// => true\n\n_.isMatch(object, { 'age': 36 });\n// => false\n
\n
\n
" } ,{ "href":"/isMatchWith", - "html":"

isMatchWith source npm

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

This method is like _.isMatch except that it accepts customizer which\nis invoked to compare values. If customizer returns undefined comparisons\nare handled by the method instead. The customizer is invoked with three\narguments: (objValue, srcValue, index|key, object, source).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
  3. source (Object)

    The object of property values to match.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize comparisons.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if object is a match, else false.

\n
\n

示例

\n
function isGreeting(value) {\n  return /^h(?:i|ello)$/.test(value);\n}\n\nfunction customizer(objValue, srcValue) {\n  if (isGreeting(objValue) && isGreeting(srcValue)) {\n    return true;\n  }\n}\n\nvar object = { 'greeting': 'hello' };\nvar source = { 'greeting': 'hi' };\n\n_.isMatchWith(object, source, customizer);\n// => true\n
\n
\n
" } + "html":"

isMatchWith source npm

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

This method is like _.isMatch except that it accepts customizer which\nis invoked to compare values. If customizer returns undefined comparisons\nare handled by the method instead. The customizer is invoked with three\narguments: (objValue, srcValue, index|key, object, source).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
  3. source (Object)

    The object of property values to match.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize comparisons.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if object is a match, else false.

\n
\n

示例

\n
function isGreeting(value) {\n  return /^h(?:i|ello)$/.test(value);\n}\n\nfunction customizer(objValue, srcValue) {\n  if (isGreeting(objValue) && isGreeting(srcValue)) {\n    return true;\n  }\n}\n\nvar object = { 'greeting': 'hello' };\nvar source = { 'greeting': 'hi' };\n\n_.isMatchWith(object, source, customizer);\n// => true\n
\n
\n
" } ,{ "href":"/isNaN", - "html":"

isNaN source npm

\n
_.isNaN(value)
\n\n

Checks if value is NaN.\n
\n
\nNote: This method is not the same as isNaN\nwhich returns true for undefined and other non-numeric values.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is NaN, else false.

\n
\n

示例

\n
_.isNaN(NaN);\n// => true\n\n_.isNaN(new Number(NaN));\n// => true\n\nisNaN(undefined);\n// => true\n\n_.isNaN(undefined);\n// => false\n
\n
\n
" } + "html":"

isNaN source npm

\n
_.isNaN(value)
\n\n

Checks if value is NaN.\n
\n
\nNote: This method is not the same as isNaN\nwhich returns true for undefined and other non-numeric values.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is NaN, else false.

\n
\n

示例

\n
_.isNaN(NaN);\n// => true\n\n_.isNaN(new Number(NaN));\n// => true\n\nisNaN(undefined);\n// => true\n\n_.isNaN(undefined);\n// => false\n
\n
\n
" } ,{ "href":"/isNative", - "html":"

isNative source npm

\n
_.isNative(value)
\n\n

Checks if value is a native function.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a native function, else false.

\n
\n

示例

\n
_.isNative(Array.prototype.push);\n// => true\n\n_.isNative(_);\n// => false\n
\n
\n
" } + "html":"

isNative source npm

\n
_.isNative(value)
\n\n

Checks if value is a native function.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a native function, else false.

\n
\n

示例

\n
_.isNative(Array.prototype.push);\n// => true\n\n_.isNative(_);\n// => false\n
\n
\n
" } ,{ "href":"/isNil", - "html":"

isNil source npm

\n
_.isNil(value)
\n\n

Checks if value is null or undefined.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is nullish, else false.

\n
\n

示例

\n
_.isNil(null);\n// => true\n\n_.isNil(void 0);\n// => true\n\n_.isNil(NaN);\n// => false\n
\n
\n
" } + "html":"

isNil source npm

\n
_.isNil(value)
\n\n

Checks if value is null or undefined.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is nullish, else false.

\n
\n

示例

\n
_.isNil(null);\n// => true\n\n_.isNil(void 0);\n// => true\n\n_.isNil(NaN);\n// => false\n
\n
\n
" } ,{ "href":"/isNull", - "html":"

isNull source npm

\n
_.isNull(value)
\n\n

Checks if value is null.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is null, else false.

\n
\n

示例

\n
_.isNull(null);\n// => true\n\n_.isNull(void 0);\n// => false\n
\n
\n
" } + "html":"

isNull source npm

\n
_.isNull(value)
\n\n

Checks if value is null.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is null, else false.

\n
\n

示例

\n
_.isNull(null);\n// => true\n\n_.isNull(void 0);\n// => false\n
\n
\n
" } ,{ "href":"/isNumber", - "html":"

isNumber source npm

\n
_.isNumber(value)
\n\n

Checks if value is classified as a Number primitive or object.\n
\n
\nNote: To exclude Infinity, -Infinity, and NaN, which are classified\nas numbers, use the _.isFinite method.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isNumber(3);\n// => true\n\n_.isNumber(Number.MIN_VALUE);\n// => true\n\n_.isNumber(Infinity);\n// => true\n\n_.isNumber('3');\n// => false\n
\n
\n
" } + "html":"

isNumber source npm

\n
_.isNumber(value)
\n\n

Checks if value is classified as a Number primitive or object.\n
\n
\nNote: To exclude Infinity, -Infinity, and NaN, which are classified\nas numbers, use the _.isFinite method.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isNumber(3);\n// => true\n\n_.isNumber(Number.MIN_VALUE);\n// => true\n\n_.isNumber(Infinity);\n// => true\n\n_.isNumber('3');\n// => false\n
\n
\n
" } ,{ "href":"/isObject", - "html":"

isObject source npm

\n
_.isObject(value)
\n\n

Checks if value is the language type of Object.\n(e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an object, else false.

\n
\n

示例

\n
_.isObject({});\n// => true\n\n_.isObject([1, 2, 3]);\n// => true\n\n_.isObject(_.noop);\n// => true\n\n_.isObject(null);\n// => false\n
\n
\n
" } + "html":"

isObject source npm

\n
_.isObject(value)
\n\n

Checks if value is the language type of Object.\n(e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is an object, else false.

\n
\n

示例

\n
_.isObject({});\n// => true\n\n_.isObject([1, 2, 3]);\n// => true\n\n_.isObject(_.noop);\n// => true\n\n_.isObject(null);\n// => false\n
\n
\n
" } ,{ "href":"/isObjectLike", - "html":"

isObjectLike source npm

\n
_.isObjectLike(value)
\n\n

Checks if value is object-like. A value is object-like if it's not null\nand has a typeof result of "object".

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is object-like, else false.

\n
\n

示例

\n
_.isObjectLike({});\n// => true\n\n_.isObjectLike([1, 2, 3]);\n// => true\n\n_.isObjectLike(_.noop);\n// => false\n\n_.isObjectLike(null);\n// => false\n
\n
\n
" } + "html":"

isObjectLike source npm

\n
_.isObjectLike(value)
\n\n

Checks if value is object-like. A value is object-like if it's not null\nand has a typeof result of "object".

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is object-like, else false.

\n
\n

示例

\n
_.isObjectLike({});\n// => true\n\n_.isObjectLike([1, 2, 3]);\n// => true\n\n_.isObjectLike(_.noop);\n// => false\n\n_.isObjectLike(null);\n// => false\n
\n
\n
" } ,{ "href":"/isPlainObject", - "html":"

isPlainObject source npm

\n
_.isPlainObject(value)
\n\n

Checks if value is a plain object, that is, an object created by the\nObject constructor or one with a [[Prototype]] of null.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a plain object, else false.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n}\n\n_.isPlainObject(new Foo);\n// => false\n\n_.isPlainObject([1, 2, 3]);\n// => false\n\n_.isPlainObject({ 'x': 0, 'y': 0 });\n// => true\n\n_.isPlainObject(Object.create(null));\n// => true\n
\n
\n
" } + "html":"

isPlainObject source npm

\n
_.isPlainObject(value)
\n\n

Checks if value is a plain object, that is, an object created by the\nObject constructor or one with a [[Prototype]] of null.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a plain object, else false.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n}\n\n_.isPlainObject(new Foo);\n// => false\n\n_.isPlainObject([1, 2, 3]);\n// => false\n\n_.isPlainObject({ 'x': 0, 'y': 0 });\n// => true\n\n_.isPlainObject(Object.create(null));\n// => true\n
\n
\n
" } ,{ "href":"/isRegExp", - "html":"

isRegExp source npm

\n
_.isRegExp(value)
\n\n

Checks if value is classified as a RegExp object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isRegExp(/abc/);\n// => true\n\n_.isRegExp('/abc/');\n// => false\n
\n
\n
" } + "html":"

isRegExp source npm

\n
_.isRegExp(value)
\n\n

Checks if value is classified as a RegExp object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isRegExp(/abc/);\n// => true\n\n_.isRegExp('/abc/');\n// => false\n
\n
\n
" } ,{ "href":"/isSafeInteger", - "html":"

isSafeInteger source npm

\n
_.isSafeInteger(value)
\n\n

Checks if value is a safe integer. An integer is safe if it's an IEEE-754\ndouble precision number which isn't the result of a rounded unsafe integer.\n
\n
\nNote: This method is based on Number.isSafeInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a safe integer, else false.

\n
\n

示例

\n
_.isSafeInteger(3);\n// => true\n\n_.isSafeInteger(Number.MIN_VALUE);\n// => false\n\n_.isSafeInteger(Infinity);\n// => false\n\n_.isSafeInteger('3');\n// => false\n
\n
\n
" } + "html":"

isSafeInteger source npm

\n
_.isSafeInteger(value)
\n\n

Checks if value is a safe integer. An integer is safe if it's an IEEE-754\ndouble precision number which isn't the result of a rounded unsafe integer.\n
\n
\nNote: This method is based on Number.isSafeInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a safe integer, else false.

\n
\n

示例

\n
_.isSafeInteger(3);\n// => true\n\n_.isSafeInteger(Number.MIN_VALUE);\n// => false\n\n_.isSafeInteger(Infinity);\n// => false\n\n_.isSafeInteger('3');\n// => false\n
\n
\n
" } ,{ "href":"/isString", - "html":"

isString source npm

\n
_.isString(value)
\n\n

Checks if value is classified as a String primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isString('abc');\n// => true\n\n_.isString(1);\n// => false\n
\n
\n
" } + "html":"

isString source npm

\n
_.isString(value)
\n\n

Checks if value is classified as a String primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isString('abc');\n// => true\n\n_.isString(1);\n// => false\n
\n
\n
" } ,{ "href":"/isSymbol", - "html":"

isSymbol source npm

\n
_.isSymbol(value)
\n\n

Checks if value is classified as a Symbol primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isSymbol(Symbol.iterator);\n// => true\n\n_.isSymbol('abc');\n// => false\n
\n
\n
" } + "html":"

isSymbol source npm

\n
_.isSymbol(value)
\n\n

Checks if value is classified as a Symbol primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isSymbol(Symbol.iterator);\n// => true\n\n_.isSymbol('abc');\n// => false\n
\n
\n
" } ,{ "href":"/isTypedArray", - "html":"

isTypedArray source npm

\n
_.isTypedArray(value)
\n\n

Checks if value is classified as a typed array.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isTypedArray(new Uint8Array);\n// => true\n\n_.isTypedArray([]);\n// => false\n
\n
\n
" } + "html":"

isTypedArray source npm

\n
_.isTypedArray(value)
\n\n

Checks if value is classified as a typed array.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is correctly classified, else false.

\n
\n

示例

\n
_.isTypedArray(new Uint8Array);\n// => true\n\n_.isTypedArray([]);\n// => false\n
\n
\n
" } ,{ "href":"/isUndefined", - "html":"

isUndefined source npm

\n
_.isUndefined(value)
\n\n

Checks if value is undefined.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is undefined, else false.

\n
\n

示例

\n
_.isUndefined(void 0);\n// => true\n\n_.isUndefined(null);\n// => false\n
\n
\n
" } + "html":"

isUndefined source npm

\n
_.isUndefined(value)
\n\n

Checks if value is undefined.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to check.

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is undefined, else false.

\n
\n

示例

\n
_.isUndefined(void 0);\n// => true\n\n_.isUndefined(null);\n// => false\n
\n
\n
" } ,{ "href":"/lt", - "html":"

lt source npm

\n
_.lt(value, other)
\n\n

Checks if value is less than other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is less than other, else false.

\n
\n

示例

\n
_.lt(1, 3);\n// => true\n\n_.lt(3, 3);\n// => false\n\n_.lt(3, 1);\n// => false\n
\n
\n
" } + "html":"

lt source npm

\n
_.lt(value, other)
\n\n

Checks if value is less than other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is less than other, else false.

\n
\n

示例

\n
_.lt(1, 3);\n// => true\n\n_.lt(3, 3);\n// => false\n\n_.lt(3, 1);\n// => false\n
\n
\n
" } ,{ "href":"/lte", - "html":"

lte source npm

\n
_.lte(value, other)
\n\n

Checks if value is less than or equal to other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is less than or equal to other, else false.

\n
\n

示例

\n
_.lte(1, 3);\n// => true\n\n_.lte(3, 3);\n// => true\n\n_.lte(3, 1);\n// => false\n
\n
\n
" } + "html":"

lte source npm

\n
_.lte(value, other)
\n\n

Checks if value is less than or equal to other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to compare.

    \n
  2. \n
  3. other (*)

    The other value to compare.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is less than or equal to other, else false.

\n
\n

示例

\n
_.lte(1, 3);\n// => true\n\n_.lte(3, 3);\n// => true\n\n_.lte(3, 1);\n// => false\n
\n
\n
" } ,{ "href":"/toArray", - "html":"

toArray source npm

\n
_.toArray(value)
\n\n

Converts value to an array.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the converted array.

\n
\n

示例

\n
(function() {\n  return _.toArray(arguments).slice(1);\n}(1, 2, 3));\n// => [2, 3]\n
\n
\n
" } + "html":"

toArray source npm

\n
_.toArray(value)
\n\n

Converts value to an array.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the converted array.

\n
\n

示例

\n
(function() {\n  return _.toArray(arguments).slice(1);\n}(1, 2, 3));\n// => [2, 3]\n
\n
\n
" } ,{ "href":"/toInteger", - "html":"

toInteger source npm

\n
_.toInteger(value)
\n\n

Converts value to an integer.\n
\n
\nNote: This function is loosely based on ToInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the converted integer.

\n
\n

示例

\n
_.toInteger(3);\n// => 3\n\n_.toInteger(Number.MIN_VALUE);\n// => 0\n\n_.toInteger(Infinity);\n// => 1.7976931348623157e+308\n\n_.toInteger('3');\n// => 3\n
\n
\n
" } + "html":"

toInteger source npm

\n
_.toInteger(value)
\n\n

Converts value to an integer.\n
\n
\nNote: This function is loosely based on ToInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the converted integer.

\n
\n

示例

\n
_.toInteger(3);\n// => 3\n\n_.toInteger(Number.MIN_VALUE);\n// => 0\n\n_.toInteger(Infinity);\n// => 1.7976931348623157e+308\n\n_.toInteger('3');\n// => 3\n
\n
\n
" } ,{ "href":"/toLength", - "html":"

toLength source npm

\n
_.toLength(value)
\n\n

Converts value to an integer suitable for use as the length of an\narray-like object.\n
\n
\nNote: This method is based on ToLength.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

示例

\n
_.toLength(3);\n// => 3\n\n_.toLength(Number.MIN_VALUE);\n// => 0\n\n_.toLength(Infinity);\n// => 4294967295\n\n_.toLength('3');\n// => 3\n
\n
\n
" } + "html":"

toLength source npm

\n
_.toLength(value)
\n\n

Converts value to an integer suitable for use as the length of an\narray-like object.\n
\n
\nNote: This method is based on ToLength.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

示例

\n
_.toLength(3);\n// => 3\n\n_.toLength(Number.MIN_VALUE);\n// => 0\n\n_.toLength(Infinity);\n// => 4294967295\n\n_.toLength('3');\n// => 3\n
\n
\n
" } ,{ "href":"/toNumber", - "html":"

toNumber source npm

\n
_.toNumber(value)
\n\n

Converts value to a number.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to process.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the number.

\n
\n

示例

\n
_.toNumber(3);\n// => 3\n\n_.toNumber(Number.MIN_VALUE);\n// => 5e-324\n\n_.toNumber(Infinity);\n// => Infinity\n\n_.toNumber('3');\n// => 3\n
\n
\n
" } + "html":"

toNumber source npm

\n
_.toNumber(value)
\n\n

Converts value to a number.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to process.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the number.

\n
\n

示例

\n
_.toNumber(3);\n// => 3\n\n_.toNumber(Number.MIN_VALUE);\n// => 5e-324\n\n_.toNumber(Infinity);\n// => Infinity\n\n_.toNumber('3');\n// => 3\n
\n
\n
" } ,{ "href":"/toPlainObject", - "html":"

toPlainObject source npm

\n
_.toPlainObject(value)
\n\n

Converts value to a plain object flattening inherited enumerable\nproperties of value to own properties of the plain object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the converted plain object.

\n
\n

示例

\n
function Foo() {\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.assign({ 'a': 1 }, new Foo);\n// => { 'a': 1, 'b': 2 }\n\n_.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n// => { 'a': 1, 'b': 2, 'c': 3 }\n
\n
\n
" } + "html":"

toPlainObject source npm

\n
_.toPlainObject(value)
\n\n

Converts value to a plain object flattening inherited enumerable\nproperties of value to own properties of the plain object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (Object)

\n

Returns the converted plain object.

\n
\n

示例

\n
function Foo() {\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.assign({ 'a': 1 }, new Foo);\n// => { 'a': 1, 'b': 2 }\n\n_.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n// => { 'a': 1, 'b': 2, 'c': 3 }\n
\n
\n
" } ,{ "href":"/toSafeInteger", - "html":"

toSafeInteger source npm

\n
_.toSafeInteger(value)
\n\n

Converts value to a safe integer. A safe integer can be compared and\nrepresented correctly.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the converted integer.

\n
\n

示例

\n
_.toSafeInteger(3);\n// => 3\n\n_.toSafeInteger(Number.MIN_VALUE);\n// => 0\n\n_.toSafeInteger(Infinity);\n// => 9007199254740991\n\n_.toSafeInteger('3');\n// => 3\n
\n
\n
" } + "html":"

toSafeInteger source npm

\n
_.toSafeInteger(value)
\n\n

Converts value to a safe integer. A safe integer can be compared and\nrepresented correctly.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the converted integer.

\n
\n

示例

\n
_.toSafeInteger(3);\n// => 3\n\n_.toSafeInteger(Number.MIN_VALUE);\n// => 0\n\n_.toSafeInteger(Infinity);\n// => 9007199254740991\n\n_.toSafeInteger('3');\n// => 3\n
\n
\n
" } ,{ "href":"/toString", - "html":"

toString source npm

\n
_.toString(value)
\n\n

Converts value to a string if it's not one. An empty string is returned\nfor null and undefined values. The sign of -0 is preserved.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to process.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the string.

\n
\n

示例

\n
_.toString(null);\n// => ''\n\n_.toString(-0);\n// => '-0'\n\n_.toString([1, 2, 3]);\n// => '1,2,3'\n
\n
\n
" } + "html":"

toString source npm

\n
_.toString(value)
\n\n

Converts value to a string if it's not one. An empty string is returned\nfor null and undefined values. The sign of -0 is preserved.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to process.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the string.

\n
\n

示例

\n
_.toString(null);\n// => ''\n\n_.toString(-0);\n// => '-0'\n\n_.toString([1, 2, 3]);\n// => '1,2,3'\n
\n
\n
" } ,{ "href":"/add", - "html":"

add source npm

\n
_.add(augend, addend)
\n\n

Adds two numbers.

\n
\n\n

参数

\n
    \n
  1. augend (number)

    The first number in an addition.

    \n
  2. \n
  3. addend (number)

    The second number in an addition.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the total.

\n
\n

示例

\n
_.add(6, 4);\n// => 10\n
\n
\n
" } + "html":"

add source npm

\n
_.add(augend, addend)
\n\n

Adds two numbers.

\n
\n\n

参数

\n
    \n
  1. augend (number)

    The first number in an addition.

    \n
  2. \n
  3. addend (number)

    The second number in an addition.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the total.

\n
\n

示例

\n
_.add(6, 4);\n// => 10\n
\n
\n
" } ,{ "href":"/ceil", - "html":"

ceil source npm

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

Computes number rounded up to precision.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to round up.

    \n
  2. \n
  3. [precision=0] (number)

    The precision to round up to.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the rounded up number.

\n
\n

示例

\n
_.ceil(4.006);\n// => 5\n\n_.ceil(6.004, 2);\n// => 6.01\n\n_.ceil(6040, -2);\n// => 6100\n
\n
\n
" } + "html":"

ceil source npm

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

Computes number rounded up to precision.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to round up.

    \n
  2. \n
  3. [precision=0] (number)

    The precision to round up to.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the rounded up number.

\n
\n

示例

\n
_.ceil(4.006);\n// => 5\n\n_.ceil(6.004, 2);\n// => 6.01\n\n_.ceil(6040, -2);\n// => 6100\n
\n
\n
" } ,{ "href":"/floor", - "html":"

floor source npm

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

Computes number rounded down to precision.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to round down.

    \n
  2. \n
  3. [precision=0] (number)

    The precision to round down to.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the rounded down number.

\n
\n

示例

\n
_.floor(4.006);\n// => 4\n\n_.floor(0.046, 2);\n// => 0.04\n\n_.floor(4060, -2);\n// => 4000\n
\n
\n
" } + "html":"

floor source npm

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

Computes number rounded down to precision.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to round down.

    \n
  2. \n
  3. [precision=0] (number)

    The precision to round down to.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the rounded down number.

\n
\n

示例

\n
_.floor(4.006);\n// => 4\n\n_.floor(0.046, 2);\n// => 0.04\n\n_.floor(4060, -2);\n// => 4000\n
\n
\n
" } ,{ "href":"/max", - "html":"

max source npm

\n
_.max(array)
\n\n

Computes the maximum value of array. If array is empty or falsey\nundefined is returned.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the maximum value.

\n
\n

示例

\n
_.max([4, 2, 8, 6]);\n// => 8\n\n_.max([]);\n// => undefined\n
\n
\n
" } + "html":"

max source npm

\n
_.max(array)
\n\n

Computes the maximum value of array. If array is empty or falsey\nundefined is returned.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the maximum value.

\n
\n

示例

\n
_.max([4, 2, 8, 6]);\n// => 8\n\n_.max([]);\n// => undefined\n
\n
\n
" } ,{ "href":"/maxBy", - "html":"

maxBy source npm

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

This method is like _.max except that it accepts iteratee which is\ninvoked for each element in array to generate the criterion by which\nthe value is ranked. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the maximum value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n_.maxBy(users, function(o) { return o.age; });\n// => { 'user': 'fred', 'age': 40 }\n\n// using the `_.property` callback shorthand\n_.maxBy(users, 'age');\n// => { 'user': 'fred', 'age': 40 }\n
\n
\n
" } + "html":"

maxBy source npm

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

This method is like _.max except that it accepts iteratee which is\ninvoked for each element in array to generate the criterion by which\nthe value is ranked. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the maximum value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n_.maxBy(users, function(o) { return o.age; });\n// => { 'user': 'fred', 'age': 40 }\n\n// using the `_.property` callback shorthand\n_.maxBy(users, 'age');\n// => { 'user': 'fred', 'age': 40 }\n
\n
\n
" } ,{ "href":"/mean", - "html":"

mean source npm

\n
_.mean(array)
\n\n

Computes the mean of the values in array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the mean.

\n
\n

示例

\n
_.mean([4, 2, 8, 6]);\n// => 5\n
\n
\n
" } + "html":"

mean source npm

\n
_.mean(array)
\n\n

Computes the mean of the values in array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the mean.

\n
\n

示例

\n
_.mean([4, 2, 8, 6]);\n// => 5\n
\n
\n
" } ,{ "href":"/min", - "html":"

min source npm

\n
_.min(array)
\n\n

Computes the minimum value of array. If array is empty or falsey\nundefined is returned.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the minimum value.

\n
\n

示例

\n
_.min([4, 2, 8, 6]);\n// => 2\n\n_.min([]);\n// => undefined\n
\n
\n
" } + "html":"

min source npm

\n
_.min(array)
\n\n

Computes the minimum value of array. If array is empty or falsey\nundefined is returned.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the minimum value.

\n
\n

示例

\n
_.min([4, 2, 8, 6]);\n// => 2\n\n_.min([]);\n// => undefined\n
\n
\n
" } ,{ "href":"/minBy", - "html":"

minBy source npm

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

This method is like _.min except that it accepts iteratee which is\ninvoked for each element in array to generate the criterion by which\nthe value is ranked. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the minimum value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n_.minBy(users, function(o) { return o.age; });\n// => { 'user': 'barney', 'age': 36 }\n\n// using the `_.property` callback shorthand\n_.minBy(users, 'age');\n// => { 'user': 'barney', 'age': 36 }\n
\n
\n
" } + "html":"

minBy source npm

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

This method is like _.min except that it accepts iteratee which is\ninvoked for each element in array to generate the criterion by which\nthe value is ranked. The iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (*)

\n

Returns the minimum value.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n_.minBy(users, function(o) { return o.age; });\n// => { 'user': 'barney', 'age': 36 }\n\n// using the `_.property` callback shorthand\n_.minBy(users, 'age');\n// => { 'user': 'barney', 'age': 36 }\n
\n
\n
" } ,{ "href":"/round", - "html":"

round source npm

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

Computes number rounded to precision.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to round.

    \n
  2. \n
  3. [precision=0] (number)

    The precision to round to.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the rounded number.

\n
\n

示例

\n
_.round(4.006);\n// => 4\n\n_.round(4.006, 2);\n// => 4.01\n\n_.round(4060, -2);\n// => 4100\n
\n
\n
" } + "html":"

round source npm

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

Computes number rounded to precision.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to round.

    \n
  2. \n
  3. [precision=0] (number)

    The precision to round to.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the rounded number.

\n
\n

示例

\n
_.round(4.006);\n// => 4\n\n_.round(4.006, 2);\n// => 4.01\n\n_.round(4060, -2);\n// => 4100\n
\n
\n
" } ,{ "href":"/subtract", - "html":"

subtract source npm

\n
_.subtract(minuend, subtrahend)
\n\n

Subtract two numbers.

\n
\n\n

参数

\n
    \n
  1. minuend (number)

    The first number in a subtraction.

    \n
  2. \n
  3. subtrahend (number)

    The second number in a subtraction.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the difference.

\n
\n

示例

\n
_.subtract(6, 4);\n// => 2\n
\n
\n
" } + "html":"

subtract source npm

\n
_.subtract(minuend, subtrahend)
\n\n

Subtract two numbers.

\n
\n\n

参数

\n
    \n
  1. minuend (number)

    The first number in a subtraction.

    \n
  2. \n
  3. subtrahend (number)

    The second number in a subtraction.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the difference.

\n
\n

示例

\n
_.subtract(6, 4);\n// => 2\n
\n
\n
" } ,{ "href":"/sum", - "html":"

sum source npm

\n
_.sum(array)
\n\n

Computes the sum of the values in array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the sum.

\n
\n

示例

\n
_.sum([4, 2, 8, 6]);\n// => 20\n
\n
\n
" } + "html":"

sum source npm

\n
_.sum(array)
\n\n

Computes the sum of the values in array.

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the sum.

\n
\n

示例

\n
_.sum([4, 2, 8, 6]);\n// => 20\n
\n
\n
" } ,{ "href":"/sumBy", - "html":"

sumBy source npm

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

This method is like _.sum except that it accepts iteratee which is\ninvoked for each element in array to generate the value to be summed.\nThe iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the sum.

\n
\n

示例

\n
var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n\n_.sumBy(objects, function(o) { return o.n; });\n// => 20\n\n// using the `_.property` callback shorthand\n_.sumBy(objects, 'n');\n// => 20\n
\n
\n
" } + "html":"

sumBy source npm

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

This method is like _.sum except that it accepts iteratee which is\ninvoked for each element in array to generate the value to be summed.\nThe iteratee is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The iteratee invoked per element.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the sum.

\n
\n

示例

\n
var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];\n\n_.sumBy(objects, function(o) { return o.n; });\n// => 20\n\n// using the `_.property` callback shorthand\n_.sumBy(objects, 'n');\n// => 20\n
\n
\n
" } ,{ "href":"/stringSize", - "html":"

stringSize source

\n
stringSize(string)
\n\n

Gets the number of symbols in string.

\n
\n\n

参数

\n
    \n
  1. string (string)

    The string to inspect.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the string size.

\n
\n
" } + "html":"

stringSize source

\n
stringSize(string)
\n\n

Gets the number of symbols in string.

\n
\n\n

参数

\n
    \n
  1. string (string)

    The string to inspect.

    \n
  2. \n
\n

返回值 (number)

\n

Returns the string size.

\n
\n
" } ,{ "href":"/templateSettings-imports-_", - "html":"

templateSettings.imports._ source

\n
_.templateSettings.imports._
\n\n

A reference to the lodash function.

\n
\n\n
" } + "html":"

templateSettings.imports._ source

\n
_.templateSettings.imports._
\n\n

A reference to the lodash function.

\n
\n\n
" } ,{ "href":"/clamp", - "html":"

clamp source npm

\n
_.clamp(number, [min], max)
\n\n

Returns a number whose value is limited to the given range specified\nby min and max.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number whose value is to be limited.

    \n
  2. \n
  3. [min] (number)

    The minimum possible value.

    \n
  4. \n
  5. max (number)

    The maximum possible value.

    \n
  6. \n
\n

返回值 (number)

\n

A number in the range [min, max].

\n
\n

示例

\n
_.clamp(-10, -5, 5);\n// => -5\n\n_.clamp(10, -5, 5);\n// => 5\n
\n
\n
" } + "html":"

clamp source npm

\n
_.clamp(number, [min], max)
\n\n

Returns a number whose value is limited to the given range specified\nby min and max.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number whose value is to be limited.

    \n
  2. \n
  3. [min] (number)

    The minimum possible value.

    \n
  4. \n
  5. max (number)

    The maximum possible value.

    \n
  6. \n
\n

返回值 (number)

\n

A number in the range [min, max].

\n
\n

示例

\n
_.clamp(-10, -5, 5);\n// => -5\n\n_.clamp(10, -5, 5);\n// => 5\n
\n
\n
" } ,{ "href":"/inRange", - "html":"

inRange source npm

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

Checks if n is between start and up to but not including, end. If\nend is not specified it's set to start with start then set to 0.\nIf start is greater than end the params are swapped to support\nnegative ranges.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to check.

    \n
  2. \n
  3. [start=0] (number)

    The start of the range.

    \n
  4. \n
  5. end (number)

    The end of the range.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if number is in the range, else false.

\n
\n

示例

\n
_.inRange(3, 2, 4);\n// => true\n\n_.inRange(4, 8);\n// => true\n\n_.inRange(4, 2);\n// => false\n\n_.inRange(2, 2);\n// => false\n\n_.inRange(1.2, 2);\n// => true\n\n_.inRange(5.2, 4);\n// => false\n\n_.inRange(-3, -2, -6);\n// => true\n
\n
\n
" } + "html":"

inRange source npm

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

Checks if n is between start and up to but not including, end. If\nend is not specified it's set to start with start then set to 0.\nIf start is greater than end the params are swapped to support\nnegative ranges.

\n
\n\n

参数

\n
    \n
  1. number (number)

    The number to check.

    \n
  2. \n
  3. [start=0] (number)

    The start of the range.

    \n
  4. \n
  5. end (number)

    The end of the range.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if number is in the range, else false.

\n
\n

示例

\n
_.inRange(3, 2, 4);\n// => true\n\n_.inRange(4, 8);\n// => true\n\n_.inRange(4, 2);\n// => false\n\n_.inRange(2, 2);\n// => false\n\n_.inRange(1.2, 2);\n// => true\n\n_.inRange(5.2, 4);\n// => false\n\n_.inRange(-3, -2, -6);\n// => true\n
\n
\n
" } ,{ "href":"/random", - "html":"

random source npm

\n
_.random([min=0], [max=1], [floating])
\n\n

Produces a random number between min and max (inclusive). If only one\nargument is provided a number between 0 and the given number is returned.\nIf floating is true, or either min or max are floats, a\nfloating-point number is returned instead of an integer.\n
\n
\nNote: JavaScript follows the IEEE-754 standard for resolving\nfloating-point values which can produce unexpected results.

\n
\n\n

参数

\n
    \n
  1. [min=0] (number)

    The minimum possible value.

    \n
  2. \n
  3. [max=1] (number)

    The maximum possible value.

    \n
  4. \n
  5. [floating] (boolean)

    Specify returning a floating-point number.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the random number.

\n
\n

示例

\n
_.random(0, 5);\n// => an integer between 0 and 5\n\n_.random(5);\n// => also an integer between 0 and 5\n\n_.random(5, true);\n// => a floating-point number between 0 and 5\n\n_.random(1.2, 5.2);\n// => a floating-point number between 1.2 and 5.2\n
\n
\n
" } + "html":"

random source npm

\n
_.random([min=0], [max=1], [floating])
\n\n

Produces a random number between min and max (inclusive). If only one\nargument is provided a number between 0 and the given number is returned.\nIf floating is true, or either min or max are floats, a\nfloating-point number is returned instead of an integer.\n
\n
\nNote: JavaScript follows the IEEE-754 standard for resolving\nfloating-point values which can produce unexpected results.

\n
\n\n

参数

\n
    \n
  1. [min=0] (number)

    The minimum possible value.

    \n
  2. \n
  3. [max=1] (number)

    The maximum possible value.

    \n
  4. \n
  5. [floating] (boolean)

    Specify returning a floating-point number.

    \n
  6. \n
\n

返回值 (number)

\n

Returns the random number.

\n
\n

示例

\n
_.random(0, 5);\n// => an integer between 0 and 5\n\n_.random(5);\n// => also an integer between 0 and 5\n\n_.random(5, true);\n// => a floating-point number between 0 and 5\n\n_.random(1.2, 5.2);\n// => a floating-point number between 1.2 and 5.2\n
\n
\n
" } ,{ "href":"/assign", - "html":"

assign source npm

\n
_.assign(object, [sources])
\n\n

Assigns own enumerable properties of source objects to the destination\nobject. Source objects are applied from left to right. Subsequent sources\noverwrite property assignments of previous sources.\n
\n
\nNote: This method mutates object and is loosely based on\nObject.assign.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.c = 3;\n}\n\nfunction Bar() {\n  this.e = 5;\n}\n\nFoo.prototype.d = 4;\nBar.prototype.f = 6;\n\n_.assign({ 'a': 1 }, new Foo, new Bar);\n// => { 'a': 1, 'c': 3, 'e': 5 }\n
\n
\n
" } + "html":"

assign source npm

\n
_.assign(object, [sources])
\n\n

Assigns own enumerable properties of source objects to the destination\nobject. Source objects are applied from left to right. Subsequent sources\noverwrite property assignments of previous sources.\n
\n
\nNote: This method mutates object and is loosely based on\nObject.assign.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.c = 3;\n}\n\nfunction Bar() {\n  this.e = 5;\n}\n\nFoo.prototype.d = 4;\nBar.prototype.f = 6;\n\n_.assign({ 'a': 1 }, new Foo, new Bar);\n// => { 'a': 1, 'c': 3, 'e': 5 }\n
\n
\n
" } ,{ "href":"/assignIn", - "html":"

assignIn extend source npm

\n
_.assignIn(object, [sources])
\n\n

This method is like _.assign except that it iterates over own and\ninherited source properties.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.b = 2;\n}\n\nfunction Bar() {\n  this.d = 4;\n}\n\nFoo.prototype.c = 3;\nBar.prototype.e = 5;\n\n_.assignIn({ 'a': 1 }, new Foo, new Bar);\n// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }\n
\n
\n
" } + "html":"

assignIn extend source npm

\n
_.assignIn(object, [sources])
\n\n

This method is like _.assign except that it iterates over own and\ninherited source properties.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.b = 2;\n}\n\nfunction Bar() {\n  this.d = 4;\n}\n\nFoo.prototype.c = 3;\nBar.prototype.e = 5;\n\n_.assignIn({ 'a': 1 }, new Foo, new Bar);\n// => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }\n
\n
\n
" } ,{ "href":"/assignInWith", - "html":"

assignInWith extendWith source npm

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

This method is like _.assignIn except that it accepts customizer which\nis invoked to produce the assigned values. If customizer returns undefined\nassignment is handled by the method instead. The customizer is invoked\nwith five arguments: (objValue, srcValue, key, object, source).\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. sources (...Object)

    The source objects.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize assigned values.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function customizer(objValue, srcValue) {\n  return _.isUndefined(objValue) ? srcValue : objValue;\n}\n\nvar defaults = _.partialRight(_.assignInWith, customizer);\n\ndefaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n// => { 'a': 1, 'b': 2 }\n
\n
\n
" } + "html":"

assignInWith extendWith source npm

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

This method is like _.assignIn except that it accepts customizer which\nis invoked to produce the assigned values. If customizer returns undefined\nassignment is handled by the method instead. The customizer is invoked\nwith five arguments: (objValue, srcValue, key, object, source).\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. sources (...Object)

    The source objects.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize assigned values.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function customizer(objValue, srcValue) {\n  return _.isUndefined(objValue) ? srcValue : objValue;\n}\n\nvar defaults = _.partialRight(_.assignInWith, customizer);\n\ndefaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n// => { 'a': 1, 'b': 2 }\n
\n
\n
" } ,{ "href":"/assignWith", - "html":"

assignWith source npm

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

This method is like _.assign except that it accepts customizer which\nis invoked to produce the assigned values. If customizer returns undefined\nassignment is handled by the method instead. The customizer is invoked\nwith five arguments: (objValue, srcValue, key, object, source).\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. sources (...Object)

    The source objects.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize assigned values.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function customizer(objValue, srcValue) {\n  return _.isUndefined(objValue) ? srcValue : objValue;\n}\n\nvar defaults = _.partialRight(_.assignWith, customizer);\n\ndefaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n// => { 'a': 1, 'b': 2 }\n
\n
\n
" } + "html":"

assignWith source npm

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

This method is like _.assign except that it accepts customizer which\nis invoked to produce the assigned values. If customizer returns undefined\nassignment is handled by the method instead. The customizer is invoked\nwith five arguments: (objValue, srcValue, key, object, source).\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. sources (...Object)

    The source objects.

    \n
  4. \n
  5. [customizer] (Function)

    The function to customize assigned values.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function customizer(objValue, srcValue) {\n  return _.isUndefined(objValue) ? srcValue : objValue;\n}\n\nvar defaults = _.partialRight(_.assignWith, customizer);\n\ndefaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n// => { 'a': 1, 'b': 2 }\n
\n
\n
" } ,{ "href":"/at", - "html":"

at source npm

\n
_.at(object, [paths])
\n\n

Creates an array of values corresponding to paths of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [paths] (...(string|string[])

    The property paths of elements to pick, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of picked elements.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n\n_.at(object, ['a[0].b.c', 'a[1]']);\n// => [3, 4]\n\n_.at(['a', 'b', 'c'], 0, 2);\n// => ['a', 'c']\n
\n
\n
" } + "html":"

at source npm

\n
_.at(object, [paths])
\n\n

Creates an array of values corresponding to paths of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [paths] (...(string|string[])

    The property paths of elements to pick, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the new array of picked elements.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n\n_.at(object, ['a[0].b.c', 'a[1]']);\n// => [3, 4]\n\n_.at(['a', 'b', 'c'], 0, 2);\n// => ['a', 'c']\n
\n
\n
" } ,{ "href":"/create", - "html":"

create source npm

\n
_.create(prototype, [properties])
\n\n

Creates an object that inherits from the prototype object. If a properties\nobject is provided its own enumerable properties are assigned to the created object.

\n
\n\n

参数

\n
    \n
  1. prototype (Object)

    The object to inherit from.

    \n
  2. \n
  3. [properties] (Object)

    The properties to assign to the object.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
function Shape() {\n  this.x = 0;\n  this.y = 0;\n}\n\nfunction Circle() {\n  Shape.call(this);\n}\n\nCircle.prototype = _.create(Shape.prototype, {\n  'constructor': Circle\n});\n\nvar circle = new Circle;\ncircle instanceof Circle;\n// => true\n\ncircle instanceof Shape;\n// => true\n
\n
\n
" } + "html":"

create source npm

\n
_.create(prototype, [properties])
\n\n

Creates an object that inherits from the prototype object. If a properties\nobject is provided its own enumerable properties are assigned to the created object.

\n
\n\n

参数

\n
    \n
  1. prototype (Object)

    The object to inherit from.

    \n
  2. \n
  3. [properties] (Object)

    The properties to assign to the object.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
function Shape() {\n  this.x = 0;\n  this.y = 0;\n}\n\nfunction Circle() {\n  Shape.call(this);\n}\n\nCircle.prototype = _.create(Shape.prototype, {\n  'constructor': Circle\n});\n\nvar circle = new Circle;\ncircle instanceof Circle;\n// => true\n\ncircle instanceof Shape;\n// => true\n
\n
\n
" } ,{ "href":"/defaults", - "html":"

defaults source npm

\n
_.defaults(object, [sources])
\n\n

Assigns own and inherited enumerable properties of source objects to the\ndestination object for all destination properties that resolve to undefined.\nSource objects are applied from left to right. Once a property is set,\nadditional values of the same property are ignored.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
_.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n// => { 'user': 'barney', 'age': 36 }\n
\n
\n
" } + "html":"

defaults source npm

\n
_.defaults(object, [sources])
\n\n

Assigns own and inherited enumerable properties of source objects to the\ndestination object for all destination properties that resolve to undefined.\nSource objects are applied from left to right. Once a property is set,\nadditional values of the same property are ignored.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
_.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });\n// => { 'user': 'barney', 'age': 36 }\n
\n
\n
" } ,{ "href":"/defaultsDeep", - "html":"

defaultsDeep source npm

\n
_.defaultsDeep(object, [sources])
\n\n

This method is like _.defaults except that it recursively assigns\ndefault properties.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
_.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });\n// => { 'user': { 'name': 'barney', 'age': 36 } }\n
\n
\n
" } + "html":"

defaultsDeep source npm

\n
_.defaultsDeep(object, [sources])
\n\n

This method is like _.defaults except that it recursively assigns\ndefault properties.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
_.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });\n// => { 'user': { 'name': 'barney', 'age': 36 } }\n
\n
\n
" } ,{ "href":"/findKey", - "html":"

findKey source npm

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

This method is like _.find except that it returns the key of the first\nelement predicate returns truthy for instead of the element itself.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (string|undefined)

\n

Returns the key of the matched element, else undefined.

\n
\n

示例

\n
var users = {\n  'barney':  { 'age': 36, 'active': true },\n  'fred':    { 'age': 40, 'active': false },\n  'pebbles': { 'age': 1,  'active': true }\n};\n\n_.findKey(users, function(o) { return o.age < 40; });\n// => 'barney' (iteration order is not guaranteed)\n\n// using the `_.matches` callback shorthand\n_.findKey(users, { 'age': 1, 'active': true });\n// => 'pebbles'\n\n// using the `_.matchesProperty` callback shorthand\n_.findKey(users, ['active', false]);\n// => 'fred'\n\n// using the `_.property` callback shorthand\n_.findKey(users, 'active');\n// => 'barney'\n
\n
\n
" } + "html":"

findKey source npm

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

This method is like _.find except that it returns the key of the first\nelement predicate returns truthy for instead of the element itself.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (string|undefined)

\n

Returns the key of the matched element, else undefined.

\n
\n

示例

\n
var users = {\n  'barney':  { 'age': 36, 'active': true },\n  'fred':    { 'age': 40, 'active': false },\n  'pebbles': { 'age': 1,  'active': true }\n};\n\n_.findKey(users, function(o) { return o.age < 40; });\n// => 'barney' (iteration order is not guaranteed)\n\n// using the `_.matches` callback shorthand\n_.findKey(users, { 'age': 1, 'active': true });\n// => 'pebbles'\n\n// using the `_.matchesProperty` callback shorthand\n_.findKey(users, ['active', false]);\n// => 'fred'\n\n// using the `_.property` callback shorthand\n_.findKey(users, 'active');\n// => 'barney'\n
\n
\n
" } ,{ "href":"/findLastKey", - "html":"

findLastKey source npm

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

This method is like _.findKey except that it iterates over elements of\na collection in the opposite order.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (string|undefined)

\n

Returns the key of the matched element, else undefined.

\n
\n

示例

\n
var users = {\n  'barney':  { 'age': 36, 'active': true },\n  'fred':    { 'age': 40, 'active': false },\n  'pebbles': { 'age': 1,  'active': true }\n};\n\n_.findLastKey(users, function(o) { return o.age < 40; });\n// => returns 'pebbles' assuming `_.findKey` returns 'barney'\n\n// using the `_.matches` callback shorthand\n_.findLastKey(users, { 'age': 36, 'active': true });\n// => 'barney'\n\n// using the `_.matchesProperty` callback shorthand\n_.findLastKey(users, ['active', false]);\n// => 'fred'\n\n// using the `_.property` callback shorthand\n_.findLastKey(users, 'active');\n// => 'pebbles'\n
\n
\n
" } + "html":"

findLastKey source npm

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

This method is like _.findKey except that it iterates over elements of\na collection in the opposite order.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to search.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (string|undefined)

\n

Returns the key of the matched element, else undefined.

\n
\n

示例

\n
var users = {\n  'barney':  { 'age': 36, 'active': true },\n  'fred':    { 'age': 40, 'active': false },\n  'pebbles': { 'age': 1,  'active': true }\n};\n\n_.findLastKey(users, function(o) { return o.age < 40; });\n// => returns 'pebbles' assuming `_.findKey` returns 'barney'\n\n// using the `_.matches` callback shorthand\n_.findLastKey(users, { 'age': 36, 'active': true });\n// => 'barney'\n\n// using the `_.matchesProperty` callback shorthand\n_.findLastKey(users, ['active', false]);\n// => 'fred'\n\n// using the `_.property` callback shorthand\n_.findLastKey(users, 'active');\n// => 'pebbles'\n
\n
\n
" } ,{ "href":"/forIn", - "html":"

forIn source npm

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

Iterates over own and inherited enumerable properties of an object invoking\niteratee for each property. The iteratee is invoked with three arguments:
\n(value, key, object). Iteratee functions may exit iteration early by explicitly\nreturning false.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forIn(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'a', 'b', then 'c' (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

forIn source npm

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

Iterates over own and inherited enumerable properties of an object invoking\niteratee for each property. The iteratee is invoked with three arguments:
\n(value, key, object). Iteratee functions may exit iteration early by explicitly\nreturning false.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forIn(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'a', 'b', then 'c' (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/forInRight", - "html":"

forInRight source npm

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

This method is like _.forIn except that it iterates over properties of\nobject in the opposite order.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forInRight(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'\n
\n
\n
" } + "html":"

forInRight source npm

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

This method is like _.forIn except that it iterates over properties of\nobject in the opposite order.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forInRight(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'\n
\n
\n
" } ,{ "href":"/forOwn", - "html":"

forOwn source npm

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

Iterates over own enumerable properties of an object invoking iteratee\nfor each property. The iteratee is invoked with three arguments:
\n(value, key, object). Iteratee functions may exit iteration early by\nexplicitly returning false.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forOwn(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'a' then 'b' (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

forOwn source npm

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

Iterates over own enumerable properties of an object invoking iteratee\nfor each property. The iteratee is invoked with three arguments:
\n(value, key, object). Iteratee functions may exit iteration early by\nexplicitly returning false.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forOwn(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'a' then 'b' (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/forOwnRight", - "html":"

forOwnRight source npm

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

This method is like _.forOwn except that it iterates over properties of\nobject in the opposite order.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forOwnRight(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'\n
\n
\n
" } + "html":"

forOwnRight source npm

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

This method is like _.forOwn except that it iterates over properties of\nobject in the opposite order.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.forOwnRight(new Foo, function(value, key) {\n  console.log(key);\n});\n// => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'\n
\n
\n
" } ,{ "href":"/functions", - "html":"

functions source npm

\n
_.functions(object)
\n\n

Creates an array of function property names from own enumerable properties\nof object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = _.constant('a');\n  this.b = _.constant('b');\n}\n\nFoo.prototype.c = _.constant('c');\n\n_.functions(new Foo);\n// => ['a', 'b']\n
\n
\n
" } + "html":"

functions source npm

\n
_.functions(object)
\n\n

Creates an array of function property names from own enumerable properties\nof object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = _.constant('a');\n  this.b = _.constant('b');\n}\n\nFoo.prototype.c = _.constant('c');\n\n_.functions(new Foo);\n// => ['a', 'b']\n
\n
\n
" } ,{ "href":"/functionsIn", - "html":"

functionsIn source npm

\n
_.functionsIn(object)
\n\n

Creates an array of function property names from own and inherited\nenumerable properties of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = _.constant('a');\n  this.b = _.constant('b');\n}\n\nFoo.prototype.c = _.constant('c');\n\n_.functionsIn(new Foo);\n// => ['a', 'b', 'c']\n
\n
\n
" } + "html":"

functionsIn source npm

\n
_.functionsIn(object)
\n\n

Creates an array of function property names from own and inherited\nenumerable properties of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to inspect.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = _.constant('a');\n  this.b = _.constant('b');\n}\n\nFoo.prototype.c = _.constant('c');\n\n_.functionsIn(new Foo);\n// => ['a', 'b', 'c']\n
\n
\n
" } ,{ "href":"/get", - "html":"

get source npm

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

Gets the value at path of object. If the resolved value is\nundefined the defaultValue is used in its place.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to get.

    \n
  4. \n
  5. [defaultValue] (*)

    The value returned if the resolved value is undefined.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the resolved value.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }] };\n\n_.get(object, 'a[0].b.c');\n// => 3\n\n_.get(object, ['a', '0', 'b', 'c']);\n// => 3\n\n_.get(object, 'a.b.c', 'default');\n// => 'default'\n
\n
\n
" } + "html":"

get source npm

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

Gets the value at path of object. If the resolved value is\nundefined the defaultValue is used in its place.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to get.

    \n
  4. \n
  5. [defaultValue] (*)

    The value returned if the resolved value is undefined.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the resolved value.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }] };\n\n_.get(object, 'a[0].b.c');\n// => 3\n\n_.get(object, ['a', '0', 'b', 'c']);\n// => 3\n\n_.get(object, 'a.b.c', 'default');\n// => 'default'\n
\n
\n
" } ,{ "href":"/has", - "html":"

has source npm

\n
_.has(object, path)
\n\n

Checks if path is a direct property of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path to check.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if path exists, else false.

\n
\n

示例

\n
var object = { 'a': { 'b': { 'c': 3 } } };\nvar other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n\n_.has(object, 'a');\n// => true\n\n_.has(object, 'a.b.c');\n// => true\n\n_.has(object, ['a', 'b', 'c']);\n// => true\n\n_.has(other, 'a');\n// => false\n
\n
\n
" } + "html":"

has source npm

\n
_.has(object, path)
\n\n

Checks if path is a direct property of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path to check.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if path exists, else false.

\n
\n

示例

\n
var object = { 'a': { 'b': { 'c': 3 } } };\nvar other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n\n_.has(object, 'a');\n// => true\n\n_.has(object, 'a.b.c');\n// => true\n\n_.has(object, ['a', 'b', 'c']);\n// => true\n\n_.has(other, 'a');\n// => false\n
\n
\n
" } ,{ "href":"/hasIn", - "html":"

hasIn source npm

\n
_.hasIn(object, path)
\n\n

Checks if path is a direct or inherited property of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path to check.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if path exists, else false.

\n
\n

示例

\n
var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n\n_.hasIn(object, 'a');\n// => true\n\n_.hasIn(object, 'a.b.c');\n// => true\n\n_.hasIn(object, ['a', 'b', 'c']);\n// => true\n\n_.hasIn(object, 'b');\n// => false\n
\n
\n
" } + "html":"

hasIn source npm

\n
_.hasIn(object, path)
\n\n

Checks if path is a direct or inherited property of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path to check.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if path exists, else false.

\n
\n

示例

\n
var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });\n\n_.hasIn(object, 'a');\n// => true\n\n_.hasIn(object, 'a.b.c');\n// => true\n\n_.hasIn(object, ['a', 'b', 'c']);\n// => true\n\n_.hasIn(object, 'b');\n// => false\n
\n
\n
" } ,{ "href":"/invert", - "html":"

invert source npm

\n
_.invert(object, [multiVal])
\n\n

Creates an object composed of the inverted keys and values of object.\nIf object contains duplicate values, subsequent values overwrite property\nassignments of previous values unless multiVal is true.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to invert.

    \n
  2. \n
  3. [multiVal] (boolean)

    Allow multiple values per key.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new inverted object.

\n
\n

示例

\n
var object = { 'a': 1, 'b': 2, 'c': 1 };\n\n_.invert(object);\n// => { '1': 'c', '2': 'b' }\n\n// with `multiVal`\n_.invert(object, true);\n// => { '1': ['a', 'c'], '2': ['b'] }\n
\n
\n
" } + "html":"

invert source npm

\n
_.invert(object, [multiVal])
\n\n

Creates an object composed of the inverted keys and values of object.\nIf object contains duplicate values, subsequent values overwrite property\nassignments of previous values unless multiVal is true.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to invert.

    \n
  2. \n
  3. [multiVal] (boolean)

    Allow multiple values per key.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new inverted object.

\n
\n

示例

\n
var object = { 'a': 1, 'b': 2, 'c': 1 };\n\n_.invert(object);\n// => { '1': 'c', '2': 'b' }\n\n// with `multiVal`\n_.invert(object, true);\n// => { '1': ['a', 'c'], '2': ['b'] }\n
\n
\n
" } ,{ "href":"/invoke", - "html":"

invoke source npm

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

Invokes the method at path of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path of the method to invoke.

    \n
  4. \n
  5. [args] (...*)

    The arguments to invoke the method with.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the result of the invoked method.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n\n_.invoke(object, 'a[0].b.c.slice', 1, 3);\n// => [2, 3]\n
\n
\n
" } + "html":"

invoke source npm

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

Invokes the method at path of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path of the method to invoke.

    \n
  4. \n
  5. [args] (...*)

    The arguments to invoke the method with.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the result of the invoked method.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n\n_.invoke(object, 'a[0].b.c.slice', 1, 3);\n// => [2, 3]\n
\n
\n
" } ,{ "href":"/keys", - "html":"

keys source npm

\n
_.keys(object)
\n\n

Creates an array of the own enumerable property names of object.\n
\n
\nNote: Non-object values are coerced to objects. See the\nES spec\nfor more details.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.keys(new Foo);\n// => ['a', 'b'] (iteration order is not guaranteed)\n\n_.keys('hi');\n// => ['0', '1']\n
\n
\n
" } + "html":"

keys source npm

\n
_.keys(object)
\n\n

Creates an array of the own enumerable property names of object.\n
\n
\nNote: Non-object values are coerced to objects. See the\nES spec\nfor more details.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.keys(new Foo);\n// => ['a', 'b'] (iteration order is not guaranteed)\n\n_.keys('hi');\n// => ['0', '1']\n
\n
\n
" } ,{ "href":"/keysIn", - "html":"

keysIn source npm

\n
_.keysIn(object)
\n\n

Creates an array of the own and inherited enumerable property names of object.\n
\n
\nNote: Non-object values are coerced to objects.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.keysIn(new Foo);\n// => ['a', 'b', 'c'] (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

keysIn source npm

\n
_.keysIn(object)
\n\n

Creates an array of the own and inherited enumerable property names of object.\n
\n
\nNote: Non-object values are coerced to objects.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property names.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.keysIn(new Foo);\n// => ['a', 'b', 'c'] (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/mapKeys", - "html":"

mapKeys source npm

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

The opposite of _.mapValues; this method creates an object with the\nsame values as object and keys generated by running each own enumerable\nproperty of object through iteratee.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new mapped object.

\n
\n

示例

\n
_.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n  return key + value;\n});\n// => { 'a1': 1, 'b2': 2 }\n
\n
\n
" } + "html":"

mapKeys source npm

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

The opposite of _.mapValues; this method creates an object with the\nsame values as object and keys generated by running each own enumerable\nproperty of object through iteratee.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new mapped object.

\n
\n

示例

\n
_.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n  return key + value;\n});\n// => { 'a1': 1, 'b2': 2 }\n
\n
\n
" } ,{ "href":"/mapValues", - "html":"

mapValues source npm

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

Creates an object with the same keys as object and values generated by\nrunning each own enumerable property of object through iteratee. The\niteratee function is invoked with three arguments: (value, key, object).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new mapped object.

\n
\n

示例

\n
var users = {\n  'fred':    { 'user': 'fred',    'age': 40 },\n  'pebbles': { 'user': 'pebbles', 'age': 1 }\n};\n\n_.mapValues(users, function(o) { return o.age; });\n// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n\n// using the `_.property` callback shorthand\n_.mapValues(users, 'age');\n// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

mapValues source npm

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

Creates an object with the same keys as object and values generated by\nrunning each own enumerable property of object through iteratee. The\niteratee function is invoked with three arguments: (value, key, object).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new mapped object.

\n
\n

示例

\n
var users = {\n  'fred':    { 'user': 'fred',    'age': 40 },\n  'pebbles': { 'user': 'pebbles', 'age': 1 }\n};\n\n_.mapValues(users, function(o) { return o.age; });\n// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n\n// using the `_.property` callback shorthand\n_.mapValues(users, 'age');\n// => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/merge", - "html":"

merge source npm

\n
_.merge(object, [sources])
\n\n

Recursively merges own and inherited enumerable properties of source\nobjects into the destination object, skipping source properties that resolve\nto undefined. Array and plain object properties are merged recursively.\nOther objects and value types are overridden by assignment. Source objects\nare applied from left to right. Subsequent sources overwrite property\nassignments of previous sources.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
var users = {\n  'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n};\n\nvar ages = {\n  'data': [{ 'age': 36 }, { 'age': 40 }]\n};\n\n_.merge(users, ages);\n// => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n
\n
\n
" } + "html":"

merge source npm

\n
_.merge(object, [sources])
\n\n

Recursively merges own and inherited enumerable properties of source\nobjects into the destination object, skipping source properties that resolve\nto undefined. Array and plain object properties are merged recursively.\nOther objects and value types are overridden by assignment. Source objects\nare applied from left to right. Subsequent sources overwrite property\nassignments of previous sources.\n
\n
\nNote: This method mutates object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. [sources] (...Object)

    The source objects.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
var users = {\n  'data': [{ 'user': 'barney' }, { 'user': 'fred' }]\n};\n\nvar ages = {\n  'data': [{ 'age': 36 }, { 'age': 40 }]\n};\n\n_.merge(users, ages);\n// => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }\n
\n
\n
" } ,{ "href":"/mergeWith", - "html":"

mergeWith source npm

\n
_.mergeWith(object, sources, customizer)
\n\n

This method is like _.merge except that it accepts customizer which\nis invoked to produce the merged values of the destination and source\nproperties. If customizer returns undefined merging is handled by the\nmethod instead. The customizer is invoked with seven arguments:
\n(objValue, srcValue, key, object, source, stack).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. sources (...Object)

    The source objects.

    \n
  4. \n
  5. customizer (Function)

    The function to customize assigned values.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function customizer(objValue, srcValue) {\n  if (_.isArray(objValue)) {\n    return objValue.concat(srcValue);\n  }\n}\n\nvar object = {\n  'fruits': ['apple'],\n  'vegetables': ['beet']\n};\n\nvar other = {\n  'fruits': ['banana'],\n  'vegetables': ['carrot']\n};\n\n_.mergeWith(object, other, customizer);\n// => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n
\n
\n
" } + "html":"

mergeWith source npm

\n
_.mergeWith(object, sources, customizer)
\n\n

This method is like _.merge except that it accepts customizer which\nis invoked to produce the merged values of the destination and source\nproperties. If customizer returns undefined merging is handled by the\nmethod instead. The customizer is invoked with seven arguments:
\n(objValue, srcValue, key, object, source, stack).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The destination object.

    \n
  2. \n
  3. sources (...Object)

    The source objects.

    \n
  4. \n
  5. customizer (Function)

    The function to customize assigned values.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
function customizer(objValue, srcValue) {\n  if (_.isArray(objValue)) {\n    return objValue.concat(srcValue);\n  }\n}\n\nvar object = {\n  'fruits': ['apple'],\n  'vegetables': ['beet']\n};\n\nvar other = {\n  'fruits': ['banana'],\n  'vegetables': ['carrot']\n};\n\n_.mergeWith(object, other, customizer);\n// => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }\n
\n
\n
" } ,{ "href":"/omit", - "html":"

omit source npm

\n
_.omit(object, [props])
\n\n

The opposite of _.pick; this method creates an object composed of the\nown and inherited enumerable properties of object that are not omitted.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [props] (...(string|string[])

    The property names to omit, specified individually or in arrays..

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.omit(object, 'user');\n// => { 'age': 40 }\n
\n
\n
" } + "html":"

omit source npm

\n
_.omit(object, [props])
\n\n

The opposite of _.pick; this method creates an object composed of the\nown and inherited enumerable properties of object that are not omitted.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [props] (...(string|string[])

    The property names to omit, specified individually or in arrays..

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.omit(object, 'user');\n// => { 'age': 40 }\n
\n
\n
" } ,{ "href":"/omitBy", - "html":"

omitBy source npm

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

The opposite of _.pickBy; this method creates an object composed of the\nown and inherited enumerable properties of object that predicate\ndoesn't return truthy for.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per property.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.omitBy(object, _.isNumber);\n// => { 'user': 'fred' }\n
\n
\n
" } + "html":"

omitBy source npm

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

The opposite of _.pickBy; this method creates an object composed of the\nown and inherited enumerable properties of object that predicate\ndoesn't return truthy for.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per property.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.omitBy(object, _.isNumber);\n// => { 'user': 'fred' }\n
\n
\n
" } ,{ "href":"/pick", - "html":"

pick source npm

\n
_.pick(object, [props])
\n\n

Creates an object composed of the picked object properties.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [props] (...(string|string[])

    The property names to pick, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.pick(object, 'user');\n// => { 'user': 'fred' }\n
\n
\n
" } + "html":"

pick source npm

\n
_.pick(object, [props])
\n\n

Creates an object composed of the picked object properties.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [props] (...(string|string[])

    The property names to pick, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.pick(object, 'user');\n// => { 'user': 'fred' }\n
\n
\n
" } ,{ "href":"/pickBy", - "html":"

pickBy source npm

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

Creates an object composed of the object properties predicate returns\ntruthy for. The predicate is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per property.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.pickBy(object, _.isNumber);\n// => { 'age': 40 }\n
\n
\n
" } + "html":"

pickBy source npm

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

Creates an object composed of the object properties predicate returns\ntruthy for. The predicate is invoked with one argument: (value).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The source object.

    \n
  2. \n
  3. [predicate=_.identity] (Function|Object|string)

    The function invoked per property.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns the new object.

\n
\n

示例

\n
var object = { 'user': 'fred', 'age': 40 };\n\n_.pickBy(object, _.isNumber);\n// => { 'age': 40 }\n
\n
\n
" } ,{ "href":"/result", - "html":"

result source npm

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

This method is like _.get except that if the resolved value is a function\nit's invoked with the this binding of its parent object and its result\nis returned.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to resolve.

    \n
  4. \n
  5. [defaultValue] (*)

    The value returned if the resolved value is undefined.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the resolved value.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n\n_.result(object, 'a[0].b.c1');\n// => 3\n\n_.result(object, 'a[0].b.c2');\n// => 4\n\n_.result(object, 'a[0].b.c3', 'default');\n// => 'default'\n\n_.result(object, 'a[0].b.c3', _.constant('default'));\n// => 'default'\n
\n
\n
" } + "html":"

result source npm

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

This method is like _.get except that if the resolved value is a function\nit's invoked with the this binding of its parent object and its result\nis returned.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to resolve.

    \n
  4. \n
  5. [defaultValue] (*)

    The value returned if the resolved value is undefined.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the resolved value.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n\n_.result(object, 'a[0].b.c1');\n// => 3\n\n_.result(object, 'a[0].b.c2');\n// => 4\n\n_.result(object, 'a[0].b.c3', 'default');\n// => 'default'\n\n_.result(object, 'a[0].b.c3', _.constant('default'));\n// => 'default'\n
\n
\n
" } ,{ "href":"/set", - "html":"

set source npm

\n
_.set(object, path, value)
\n\n

Sets the value at path of object. If a portion of path doesn't exist\nit's created. Arrays are created for missing index properties while objects\nare created for all other missing properties. Use _.setWith to customize\npath creation.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to modify.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to set.

    \n
  4. \n
  5. value (*)

    The value to set.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }] };\n\n_.set(object, 'a[0].b.c', 4);\nconsole.log(object.a[0].b.c);\n// => 4\n\n_.set(object, 'x[0].y.z', 5);\nconsole.log(object.x[0].y.z);\n// => 5\n
\n
\n
" } + "html":"

set source npm

\n
_.set(object, path, value)
\n\n

Sets the value at path of object. If a portion of path doesn't exist\nit's created. Arrays are created for missing index properties while objects\nare created for all other missing properties. Use _.setWith to customize\npath creation.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to modify.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to set.

    \n
  4. \n
  5. value (*)

    The value to set.

    \n
  6. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 3 } }] };\n\n_.set(object, 'a[0].b.c', 4);\nconsole.log(object.a[0].b.c);\n// => 4\n\n_.set(object, 'x[0].y.z', 5);\nconsole.log(object.x[0].y.z);\n// => 5\n
\n
\n
" } ,{ "href":"/setWith", - "html":"

setWith source npm

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

This method is like _.set except that it accepts customizer which is\ninvoked to produce the objects of path. If customizer returns undefined\npath creation is handled by the method instead. The customizer is invoked\nwith three arguments: (nsValue, key, nsObject).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to modify.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to set.

    \n
  4. \n
  5. value (*)

    The value to set.

    \n
  6. \n
  7. [customizer] (Function)

    The function to customize assigned values.

    \n
  8. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
_.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object);\n// => { '0': { '1': { '2': 3 }, 'length': 2 } }\n
\n
\n
" } + "html":"

setWith source npm

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

This method is like _.set except that it accepts customizer which is\ninvoked to produce the objects of path. If customizer returns undefined\npath creation is handled by the method instead. The customizer is invoked\nwith three arguments: (nsValue, key, nsObject).

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to modify.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to set.

    \n
  4. \n
  5. value (*)

    The value to set.

    \n
  6. \n
  7. [customizer] (Function)

    The function to customize assigned values.

    \n
  8. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
_.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object);\n// => { '0': { '1': { '2': 3 }, 'length': 2 } }\n
\n
\n
" } ,{ "href":"/toPairs", - "html":"

toPairs source npm

\n
_.toPairs(object)
\n\n

Creates an array of own enumerable key-value pairs for object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of key-value pairs.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.toPairs(new Foo);\n// => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

toPairs source npm

\n
_.toPairs(object)
\n\n

Creates an array of own enumerable key-value pairs for object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of key-value pairs.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.toPairs(new Foo);\n// => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/toPairsIn", - "html":"

toPairsIn source npm

\n
_.toPairsIn(object)
\n\n

Creates an array of own and inherited enumerable key-value pairs for object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of key-value pairs.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.toPairsIn(new Foo);\n// => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

toPairsIn source npm

\n
_.toPairsIn(object)
\n\n

Creates an array of own and inherited enumerable key-value pairs for object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new array of key-value pairs.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.toPairsIn(new Foo);\n// => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/transform", - "html":"

transform source npm

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

An alternative to _.reduce; this method transforms object to a new\naccumulator object which is the result of running each of its own enumerable\nproperties through iteratee, with each invocation potentially mutating\nthe accumulator object. The iteratee is invoked with four arguments:
\n(accumulator, value, key, object). Iteratee functions may exit iteration\nearly by explicitly returning false.

\n
\n\n

参数

\n
    \n
  1. object (Array|Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
  5. [accumulator] (*)

    The custom accumulator value.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the accumulated value.

\n
\n

示例

\n
_.transform([2, 3, 4], function(result, n) {\n  result.push(n *= n);\n  return n % 2 == 0;\n});\n// => [4, 9]\n\n_.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n  (result[value] || (result[value] = [])).push(key);\n});\n// => { '1': ['a', 'c'], '2': ['b'] }\n
\n
\n
" } + "html":"

transform source npm

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

An alternative to _.reduce; this method transforms object to a new\naccumulator object which is the result of running each of its own enumerable\nproperties through iteratee, with each invocation potentially mutating\nthe accumulator object. The iteratee is invoked with four arguments:
\n(accumulator, value, key, object). Iteratee functions may exit iteration\nearly by explicitly returning false.

\n
\n\n

参数

\n
    \n
  1. object (Array|Object)

    The object to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
  5. [accumulator] (*)

    The custom accumulator value.

    \n
  6. \n
\n

返回值 (*)

\n

Returns the accumulated value.

\n
\n

示例

\n
_.transform([2, 3, 4], function(result, n) {\n  result.push(n *= n);\n  return n % 2 == 0;\n});\n// => [4, 9]\n\n_.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n  (result[value] || (result[value] = [])).push(key);\n});\n// => { '1': ['a', 'c'], '2': ['b'] }\n
\n
\n
" } ,{ "href":"/unset", - "html":"

unset source npm

\n
_.unset(object, path)
\n\n

Removes the property at path of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to modify.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to unset.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if the property is deleted, else false.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 7 } }] };\n_.unset(object, 'a[0].b.c');\n// => true\n\nconsole.log(object);\n// => { 'a': [{ 'b': {} }] };\n\n_.unset(object, 'a[0].b.c');\n// => true\n\nconsole.log(object);\n// => { 'a': [{ 'b': {} }] };\n
\n
\n
" } + "html":"

unset source npm

\n
_.unset(object, path)
\n\n

Removes the property at path of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to modify.

    \n
  2. \n
  3. path (Array|string)

    The path of the property to unset.

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if the property is deleted, else false.

\n
\n

示例

\n
var object = { 'a': [{ 'b': { 'c': 7 } }] };\n_.unset(object, 'a[0].b.c');\n// => true\n\nconsole.log(object);\n// => { 'a': [{ 'b': {} }] };\n\n_.unset(object, 'a[0].b.c');\n// => true\n\nconsole.log(object);\n// => { 'a': [{ 'b': {} }] };\n
\n
\n
" } ,{ "href":"/values", - "html":"

values source npm

\n
_.values(object)
\n\n

Creates an array of the own enumerable property values of object.\n
\n
\nNote: Non-object values are coerced to objects.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property values.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.values(new Foo);\n// => [1, 2] (iteration order is not guaranteed)\n\n_.values('hi');\n// => ['h', 'i']\n
\n
\n
" } + "html":"

values source npm

\n
_.values(object)
\n\n

Creates an array of the own enumerable property values of object.\n
\n
\nNote: Non-object values are coerced to objects.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property values.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.values(new Foo);\n// => [1, 2] (iteration order is not guaranteed)\n\n_.values('hi');\n// => ['h', 'i']\n
\n
\n
" } ,{ "href":"/valuesIn", - "html":"

valuesIn source npm

\n
_.valuesIn(object)
\n\n

Creates an array of the own and inherited enumerable property values of object.\n
\n
\nNote: Non-object values are coerced to objects.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property values.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.valuesIn(new Foo);\n// => [1, 2, 3] (iteration order is not guaranteed)\n
\n
\n
" } + "html":"

valuesIn source npm

\n
_.valuesIn(object)
\n\n

Creates an array of the own and inherited enumerable property values of object.\n
\n
\nNote: Non-object values are coerced to objects.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the array of property values.

\n
\n

示例

\n
function Foo() {\n  this.a = 1;\n  this.b = 2;\n}\n\nFoo.prototype.c = 3;\n\n_.valuesIn(new Foo);\n// => [1, 2, 3] (iteration order is not guaranteed)\n
\n
\n
" } ,{ "href":"/templateSettings", - "html":"

templateSettings source npm

\n
_.templateSettings
\n\n

(Object): By default, the template delimiters used by lodash are like those in\nembedded Ruby (ERB). Change the following template settings to use\nalternative delimiters.

\n
\n\n
" } + "html":"

templateSettings source npm

\n
_.templateSettings
\n\n

(Object): By default, the template delimiters used by lodash are like those in\nembedded Ruby (ERB). Change the following template settings to use\nalternative delimiters.

\n
\n\n
" } ,{ "href":"/templateSettings-escape", - "html":"

templateSettings.escape source

\n
_.templateSettings.escape
\n\n

(RegExp): Used to detect data property values to be HTML-escaped.

\n
\n\n
" } + "html":"

templateSettings.escape source

\n
_.templateSettings.escape
\n\n

(RegExp): Used to detect data property values to be HTML-escaped.

\n
\n\n
" } ,{ "href":"/templateSettings-evaluate", - "html":"

templateSettings.evaluate source

\n
_.templateSettings.evaluate
\n\n

(RegExp): Used to detect code to be evaluated.

\n
\n\n
" } + "html":"

templateSettings.evaluate source

\n
_.templateSettings.evaluate
\n\n

(RegExp): Used to detect code to be evaluated.

\n
\n\n
" } ,{ "href":"/templateSettings-imports", - "html":"

templateSettings.imports source

\n
_.templateSettings.imports
\n\n

(Object): Used to import variables into the compiled template.

\n
\n\n
" } + "html":"

templateSettings.imports source

\n
_.templateSettings.imports
\n\n

(Object): Used to import variables into the compiled template.

\n
\n\n
" } ,{ "href":"/templateSettings-interpolate", - "html":"

templateSettings.interpolate source

\n
_.templateSettings.interpolate
\n\n

(RegExp): Used to detect data property values to inject.

\n
\n\n
" } + "html":"

templateSettings.interpolate source

\n
_.templateSettings.interpolate
\n\n

(RegExp): Used to detect data property values to inject.

\n
\n\n
" } ,{ "href":"/templateSettings-variable", - "html":"

templateSettings.variable source

\n
_.templateSettings.variable
\n\n

(string): Used to reference the data object in the template text.

\n
\n\n
" } + "html":"

templateSettings.variable source

\n
_.templateSettings.variable
\n\n

(string): Used to reference the data object in the template text.

\n
\n\n
" } ,{ "href":"/VERSION", - "html":"

VERSION source

\n
_.VERSION
\n\n

(string): The semantic version number.

\n
\n\n
" } + "html":"

VERSION source

\n
_.VERSION
\n\n

(string): The semantic version number.

\n
\n\n
" } ,{ "href":"/camelCase", - "html":"

camelCase source npm

\n
_.camelCase([string=''])
\n\n

Converts string to camel case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the camel cased string.

\n
\n

示例

\n
_.camelCase('Foo Bar');\n// => 'fooBar'\n\n_.camelCase('--foo-bar');\n// => 'fooBar'\n\n_.camelCase('__foo_bar__');\n// => 'fooBar'\n
\n
\n
" } + "html":"

camelCase source npm

\n
_.camelCase([string=''])
\n\n

Converts string to camel case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the camel cased string.

\n
\n

示例

\n
_.camelCase('Foo Bar');\n// => 'fooBar'\n\n_.camelCase('--foo-bar');\n// => 'fooBar'\n\n_.camelCase('__foo_bar__');\n// => 'fooBar'\n
\n
\n
" } ,{ "href":"/capitalize", - "html":"

capitalize source npm

\n
_.capitalize([string=''])
\n\n

Converts the first character of string to upper case and the remaining\nto lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to capitalize.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the capitalized string.

\n
\n

示例

\n
_.capitalize('FRED');\n// => 'Fred'\n
\n
\n
" } + "html":"

capitalize source npm

\n
_.capitalize([string=''])
\n\n

Converts the first character of string to upper case and the remaining\nto lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to capitalize.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the capitalized string.

\n
\n

示例

\n
_.capitalize('FRED');\n// => 'Fred'\n
\n
\n
" } ,{ "href":"/deburr", - "html":"

deburr source npm

\n
_.deburr([string=''])
\n\n

Deburrs string by converting latin-1 supplementary letters#Character_table)\nto basic latin letters and removing combining diacritical marks.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to deburr.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the deburred string.

\n
\n

示例

\n
_.deburr('déjà vu');\n// => 'deja vu'\n
\n
\n
" } + "html":"

deburr source npm

\n
_.deburr([string=''])
\n\n

Deburrs string by converting latin-1 supplementary letters#Character_table)\nto basic latin letters and removing combining diacritical marks.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to deburr.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the deburred string.

\n
\n

示例

\n
_.deburr('déjà vu');\n// => 'deja vu'\n
\n
\n
" } ,{ "href":"/endsWith", - "html":"

endsWith source npm

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

Checks if string ends with the given target string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to search.

    \n
  2. \n
  3. [target] (string)

    The string to search for.

    \n
  4. \n
  5. [position=string.length] (number)

    The position to search from.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if string ends with target, else false.

\n
\n

示例

\n
_.endsWith('abc', 'c');\n// => true\n\n_.endsWith('abc', 'b');\n// => false\n\n_.endsWith('abc', 'b', 2);\n// => true\n
\n
\n
" } + "html":"

endsWith source npm

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

Checks if string ends with the given target string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to search.

    \n
  2. \n
  3. [target] (string)

    The string to search for.

    \n
  4. \n
  5. [position=string.length] (number)

    The position to search from.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if string ends with target, else false.

\n
\n

示例

\n
_.endsWith('abc', 'c');\n// => true\n\n_.endsWith('abc', 'b');\n// => false\n\n_.endsWith('abc', 'b', 2);\n// => true\n
\n
\n
" } ,{ "href":"/escape", - "html":"

escape source npm

\n
_.escape([string=''])
\n\n

Converts the characters "&", "<", ">", '"', "'", and "`" in string to\ntheir corresponding HTML entities.\n
\n
\nNote: No other characters are escaped. To escape additional\ncharacters use a third-party library like he.\n
\n
\nThough the ">" character is escaped for symmetry, characters like\n">" and "/" don't need escaping in HTML and have no special meaning\nunless they're part of a tag or unquoted attribute value.\nSee Mathias Bynens's article\n(under "semi-related fun fact") for more details.\n
\n
\nBackticks are escaped because in IE < 9, they can break out of\nattribute values or HTML comments. See #59,\n#102, #108, and\n#133 of the HTML5 Security Cheatsheet\nfor more details.\n
\n
\nWhen working with HTML you should always quote attribute values\nto reduce XSS vectors.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to escape.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the escaped string.

\n
\n

示例

\n
_.escape('fred, barney, & pebbles');\n// => 'fred, barney, &amp; pebbles'\n
\n
\n
" } + "html":"

escape source npm

\n
_.escape([string=''])
\n\n

Converts the characters "&", "<", ">", '"', "'", and "`" in string to\ntheir corresponding HTML entities.\n
\n
\nNote: No other characters are escaped. To escape additional\ncharacters use a third-party library like he.\n
\n
\nThough the ">" character is escaped for symmetry, characters like\n">" and "/" don't need escaping in HTML and have no special meaning\nunless they're part of a tag or unquoted attribute value.\nSee Mathias Bynens's article\n(under "semi-related fun fact") for more details.\n
\n
\nBackticks are escaped because in IE < 9, they can break out of\nattribute values or HTML comments. See #59,\n#102, #108, and\n#133 of the HTML5 Security Cheatsheet\nfor more details.\n
\n
\nWhen working with HTML you should always quote attribute values\nto reduce XSS vectors.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to escape.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the escaped string.

\n
\n

示例

\n
_.escape('fred, barney, & pebbles');\n// => 'fred, barney, &amp; pebbles'\n
\n
\n
" } ,{ "href":"/escapeRegExp", - "html":"

escapeRegExp source npm

\n
_.escapeRegExp([string=''])
\n\n

Escapes the RegExp special characters "^", "$", "\\", ".", "*", "+",\n"?", "(", ")", "[", "]", "{", "}", and "|" in string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to escape.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the escaped string.

\n
\n

示例

\n
_.escapeRegExp('[lodash](https://lodash.com/)');\n// => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n
\n
\n
" } + "html":"

escapeRegExp source npm

\n
_.escapeRegExp([string=''])
\n\n

Escapes the RegExp special characters "^", "$", "\\", ".", "*", "+",\n"?", "(", ")", "[", "]", "{", "}", and "|" in string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to escape.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the escaped string.

\n
\n

示例

\n
_.escapeRegExp('[lodash](https://lodash.com/)');\n// => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n
\n
\n
" } ,{ "href":"/kebabCase", - "html":"

kebabCase source npm

\n
_.kebabCase([string=''])
\n\n

Converts string to kebab case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the kebab cased string.

\n
\n

示例

\n
_.kebabCase('Foo Bar');\n// => 'foo-bar'\n\n_.kebabCase('fooBar');\n// => 'foo-bar'\n\n_.kebabCase('__foo_bar__');\n// => 'foo-bar'\n
\n
\n
" } + "html":"

kebabCase source npm

\n
_.kebabCase([string=''])
\n\n

Converts string to kebab case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the kebab cased string.

\n
\n

示例

\n
_.kebabCase('Foo Bar');\n// => 'foo-bar'\n\n_.kebabCase('fooBar');\n// => 'foo-bar'\n\n_.kebabCase('__foo_bar__');\n// => 'foo-bar'\n
\n
\n
" } ,{ "href":"/lowerCase", - "html":"

lowerCase source npm

\n
_.lowerCase([string=''])
\n\n

Converts string, as space separated words, to lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the lower cased string.

\n
\n

示例

\n
_.lowerCase('--Foo-Bar');\n// => 'foo bar'\n\n_.lowerCase('fooBar');\n// => 'foo bar'\n\n_.lowerCase('__FOO_BAR__');\n// => 'foo bar'\n
\n
\n
" } + "html":"

lowerCase source npm

\n
_.lowerCase([string=''])
\n\n

Converts string, as space separated words, to lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the lower cased string.

\n
\n

示例

\n
_.lowerCase('--Foo-Bar');\n// => 'foo bar'\n\n_.lowerCase('fooBar');\n// => 'foo bar'\n\n_.lowerCase('__FOO_BAR__');\n// => 'foo bar'\n
\n
\n
" } ,{ "href":"/lowerFirst", - "html":"

lowerFirst source npm

\n
_.lowerFirst([string=''])
\n\n

Converts the first character of string to lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the converted string.

\n
\n

示例

\n
_.lowerFirst('Fred');\n// => 'fred'\n\n_.lowerFirst('FRED');\n// => 'fRED'\n
\n
\n
" } + "html":"

lowerFirst source npm

\n
_.lowerFirst([string=''])
\n\n

Converts the first character of string to lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the converted string.

\n
\n

示例

\n
_.lowerFirst('Fred');\n// => 'fred'\n\n_.lowerFirst('FRED');\n// => 'fRED'\n
\n
\n
" } ,{ "href":"/pad", - "html":"

pad source npm

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

Pads string on the left and right sides if it's shorter than length.\nPadding characters are truncated if they can't be evenly divided by length.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to pad.

    \n
  2. \n
  3. [length=0] (number)

    The padding length.

    \n
  4. \n
  5. [chars=' '] (string)

    The string used as padding.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the padded string.

\n
\n

示例

\n
_.pad('abc', 8);\n// => '  abc   '\n\n_.pad('abc', 8, '_-');\n// => '_-abc_-_'\n\n_.pad('abc', 3);\n// => 'abc'\n
\n
\n
" } + "html":"

pad source npm

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

Pads string on the left and right sides if it's shorter than length.\nPadding characters are truncated if they can't be evenly divided by length.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to pad.

    \n
  2. \n
  3. [length=0] (number)

    The padding length.

    \n
  4. \n
  5. [chars=' '] (string)

    The string used as padding.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the padded string.

\n
\n

示例

\n
_.pad('abc', 8);\n// => '  abc   '\n\n_.pad('abc', 8, '_-');\n// => '_-abc_-_'\n\n_.pad('abc', 3);\n// => 'abc'\n
\n
\n
" } ,{ "href":"/padEnd", - "html":"

padEnd source npm

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

Pads string on the right side if it's shorter than length. Padding\ncharacters are truncated if they exceed length.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to pad.

    \n
  2. \n
  3. [length=0] (number)

    The padding length.

    \n
  4. \n
  5. [chars=' '] (string)

    The string used as padding.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the padded string.

\n
\n

示例

\n
_.padEnd('abc', 6);\n// => 'abc   '\n\n_.padEnd('abc', 6, '_-');\n// => 'abc_-_'\n\n_.padEnd('abc', 3);\n// => 'abc'\n
\n
\n
" } + "html":"

padEnd source npm

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

Pads string on the right side if it's shorter than length. Padding\ncharacters are truncated if they exceed length.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to pad.

    \n
  2. \n
  3. [length=0] (number)

    The padding length.

    \n
  4. \n
  5. [chars=' '] (string)

    The string used as padding.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the padded string.

\n
\n

示例

\n
_.padEnd('abc', 6);\n// => 'abc   '\n\n_.padEnd('abc', 6, '_-');\n// => 'abc_-_'\n\n_.padEnd('abc', 3);\n// => 'abc'\n
\n
\n
" } ,{ "href":"/padStart", - "html":"

padStart source npm

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

Pads string on the left side if it's shorter than length. Padding\ncharacters are truncated if they exceed length.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to pad.

    \n
  2. \n
  3. [length=0] (number)

    The padding length.

    \n
  4. \n
  5. [chars=' '] (string)

    The string used as padding.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the padded string.

\n
\n

示例

\n
_.padStart('abc', 6);\n// => '   abc'\n\n_.padStart('abc', 6, '_-');\n// => '_-_abc'\n\n_.padStart('abc', 3);\n// => 'abc'\n
\n
\n
" } + "html":"

padStart source npm

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

Pads string on the left side if it's shorter than length. Padding\ncharacters are truncated if they exceed length.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to pad.

    \n
  2. \n
  3. [length=0] (number)

    The padding length.

    \n
  4. \n
  5. [chars=' '] (string)

    The string used as padding.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the padded string.

\n
\n

示例

\n
_.padStart('abc', 6);\n// => '   abc'\n\n_.padStart('abc', 6, '_-');\n// => '_-_abc'\n\n_.padStart('abc', 3);\n// => 'abc'\n
\n
\n
" } ,{ "href":"/parseInt", - "html":"

parseInt source npm

\n
_.parseInt(string, [radix])
\n\n

Converts string to an integer of the specified radix. If radix is\nundefined or 0, a radix of 10 is used unless value is a hexadecimal,\nin which case a radix of 16 is used.\n
\n
\nNote: This method aligns with the ES5 implementation\nof parseInt.

\n
\n\n

参数

\n
    \n
  1. string (string)

    The string to convert.

    \n
  2. \n
  3. [radix] (number)

    The radix to interpret value by.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the converted integer.

\n
\n

示例

\n
_.parseInt('08');\n// => 8\n\n_.map(['6', '08', '10'], _.parseInt);\n// => [6, 8, 10]\n
\n
\n
" } + "html":"

parseInt source npm

\n
_.parseInt(string, [radix])
\n\n

Converts string to an integer of the specified radix. If radix is\nundefined or 0, a radix of 10 is used unless value is a hexadecimal,\nin which case a radix of 16 is used.\n
\n
\nNote: This method aligns with the ES5 implementation\nof parseInt.

\n
\n\n

参数

\n
    \n
  1. string (string)

    The string to convert.

    \n
  2. \n
  3. [radix] (number)

    The radix to interpret value by.

    \n
  4. \n
\n

返回值 (number)

\n

Returns the converted integer.

\n
\n

示例

\n
_.parseInt('08');\n// => 8\n\n_.map(['6', '08', '10'], _.parseInt);\n// => [6, 8, 10]\n
\n
\n
" } ,{ "href":"/repeat", - "html":"

repeat source npm

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

Repeats the given string n times.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to repeat.

    \n
  2. \n
  3. [n=0] (number)

    The number of times to repeat the string.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the repeated string.

\n
\n

示例

\n
_.repeat('*', 3);\n// => '***'\n\n_.repeat('abc', 2);\n// => 'abcabc'\n\n_.repeat('abc', 0);\n// => ''\n
\n
\n
" } + "html":"

repeat source npm

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

Repeats the given string n times.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to repeat.

    \n
  2. \n
  3. [n=0] (number)

    The number of times to repeat the string.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the repeated string.

\n
\n

示例

\n
_.repeat('*', 3);\n// => '***'\n\n_.repeat('abc', 2);\n// => 'abcabc'\n\n_.repeat('abc', 0);\n// => ''\n
\n
\n
" } ,{ "href":"/replace", - "html":"

replace source npm

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

Replaces matches for pattern in string with replacement.\n
\n
\nNote: This method is based on String#replace.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to modify.

    \n
  2. \n
  3. pattern (RegExp|string)

    The pattern to replace.

    \n
  4. \n
  5. replacement (Function|string)

    The match replacement.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the modified string.

\n
\n

示例

\n
_.replace('Hi Fred', 'Fred', 'Barney');\n// => 'Hi Barney'\n
\n
\n
" } + "html":"

replace source npm

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

Replaces matches for pattern in string with replacement.\n
\n
\nNote: This method is based on String#replace.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to modify.

    \n
  2. \n
  3. pattern (RegExp|string)

    The pattern to replace.

    \n
  4. \n
  5. replacement (Function|string)

    The match replacement.

    \n
  6. \n
\n

返回值 (string)

\n

Returns the modified string.

\n
\n

示例

\n
_.replace('Hi Fred', 'Fred', 'Barney');\n// => 'Hi Barney'\n
\n
\n
" } ,{ "href":"/snakeCase", - "html":"

snakeCase source npm

\n
_.snakeCase([string=''])
\n\n

Converts string to snake case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the snake cased string.

\n
\n

示例

\n
_.snakeCase('Foo Bar');\n// => 'foo_bar'\n\n_.snakeCase('fooBar');\n// => 'foo_bar'\n\n_.snakeCase('--foo-bar');\n// => 'foo_bar'\n
\n
\n
" } + "html":"

snakeCase source npm

\n
_.snakeCase([string=''])
\n\n

Converts string to snake case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the snake cased string.

\n
\n

示例

\n
_.snakeCase('Foo Bar');\n// => 'foo_bar'\n\n_.snakeCase('fooBar');\n// => 'foo_bar'\n\n_.snakeCase('--foo-bar');\n// => 'foo_bar'\n
\n
\n
" } ,{ "href":"/split", - "html":"

split source npm

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

Splits string by separator.\n
\n
\nNote: This method is based on String#split.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to split.

    \n
  2. \n
  3. separator (RegExp|string)

    The separator pattern to split by.

    \n
  4. \n
  5. [limit] (number)

    The length to truncate results to.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of string segments.

\n
\n

示例

\n
_.split('a-b-c', '-', 2);\n// => ['a', 'b']\n
\n
\n
" } + "html":"

split source npm

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

Splits string by separator.\n
\n
\nNote: This method is based on String#split.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to split.

    \n
  2. \n
  3. separator (RegExp|string)

    The separator pattern to split by.

    \n
  4. \n
  5. [limit] (number)

    The length to truncate results to.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of string segments.

\n
\n

示例

\n
_.split('a-b-c', '-', 2);\n// => ['a', 'b']\n
\n
\n
" } ,{ "href":"/startCase", - "html":"

startCase source npm

\n
_.startCase([string=''])
\n\n

Converts string to start case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the start cased string.

\n
\n

示例

\n
_.startCase('--foo-bar');\n// => 'Foo Bar'\n\n_.startCase('fooBar');\n// => 'Foo Bar'\n\n_.startCase('__foo_bar__');\n// => 'Foo Bar'\n
\n
\n
" } + "html":"

startCase source npm

\n
_.startCase([string=''])
\n\n

Converts string to start case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the start cased string.

\n
\n

示例

\n
_.startCase('--foo-bar');\n// => 'Foo Bar'\n\n_.startCase('fooBar');\n// => 'Foo Bar'\n\n_.startCase('__foo_bar__');\n// => 'Foo Bar'\n
\n
\n
" } ,{ "href":"/startsWith", - "html":"

startsWith source npm

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

Checks if string starts with the given target string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to search.

    \n
  2. \n
  3. [target] (string)

    The string to search for.

    \n
  4. \n
  5. [position=0] (number)

    The position to search from.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if string starts with target, else false.

\n
\n

示例

\n
_.startsWith('abc', 'a');\n// => true\n\n_.startsWith('abc', 'b');\n// => false\n\n_.startsWith('abc', 'b', 1);\n// => true\n
\n
\n
" } + "html":"

startsWith source npm

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

Checks if string starts with the given target string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to search.

    \n
  2. \n
  3. [target] (string)

    The string to search for.

    \n
  4. \n
  5. [position=0] (number)

    The position to search from.

    \n
  6. \n
\n

返回值 (boolean)

\n

Returns true if string starts with target, else false.

\n
\n

示例

\n
_.startsWith('abc', 'a');\n// => true\n\n_.startsWith('abc', 'b');\n// => false\n\n_.startsWith('abc', 'b', 1);\n// => true\n
\n
\n
" } ,{ "href":"/template", - "html":"

template source npm

\n
_.template([string=''], [options])
\n\n

Creates a compiled template function that can interpolate data properties\nin "interpolate" delimiters, HTML-escape interpolated data properties in\n"escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data\nproperties may be accessed as free variables in the template. If a setting\nobject is provided it takes precedence over _.templateSettings values.\n
\n
\nNote: In the development build _.template utilizes\nsourceURLs\nfor easier debugging.\n
\n
\nFor more information on precompiling templates see\nlodash's custom builds documentation.\n
\n
\nFor more information on Chrome extension sandboxes see\nChrome's extensions documentation.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The template string.

    \n
  2. \n
  3. [options] (Object)

    The options object.

    \n
  4. \n
  5. [options.escape] (RegExp)

    The HTML "escape" delimiter.

    \n
  6. \n
  7. [options.evaluate] (RegExp)

    The "evaluate" delimiter.

    \n
  8. \n
  9. [options.imports] (Object)

    An object to import into the template as free variables.

    \n
  10. \n
  11. [options.interpolate] (RegExp)

    The "interpolate" delimiter.

    \n
  12. \n
  13. [options.sourceURL] (string)

    The sourceURL of the template's compiled source.

    \n
  14. \n
  15. [options.variable] (string)

    The data object variable name.

    \n
  16. \n
\n

返回值 (Function)

\n

Returns the compiled template function.

\n
\n

示例

\n
// using the \"interpolate\" delimiter to create a compiled template\nvar compiled = _.template('hello <%= user %>!');\ncompiled({ 'user': 'fred' });\n// => 'hello fred!'\n\n// using the HTML \"escape\" delimiter to escape data property values\nvar compiled = _.template('<b><%- value %></b>');\ncompiled({ 'value': '<script>' });\n// => '<b>&lt;script&gt;</b>'\n\n// using the \"evaluate\" delimiter to execute JavaScript and generate HTML\nvar compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\ncompiled({ 'users': ['fred', 'barney'] });\n// => '<li>fred</li><li>barney</li>'\n\n// using the internal `print` function in \"evaluate\" delimiters\nvar compiled = _.template('<% print(\"hello \" + user); %>!');\ncompiled({ 'user': 'barney' });\n// => 'hello barney!'\n\n// using the ES delimiter as an alternative to the default \"interpolate\" delimiter\nvar compiled = _.template('hello ${ user }!');\ncompiled({ 'user': 'pebbles' });\n// => 'hello pebbles!'\n\n// using custom template delimiters\n_.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\nvar compiled = _.template('hello {{ user }}!');\ncompiled({ 'user': 'mustache' });\n// => 'hello mustache!'\n\n// using backslashes to treat delimiters as plain text\nvar compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\ncompiled({ 'value': 'ignored' });\n// => '<%- value %>'\n\n// using the `imports` option to import `jQuery` as `jq`\nvar text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\nvar compiled = _.template(text, { 'imports': { 'jq': jQuery } });\ncompiled({ 'users': ['fred', 'barney'] });\n// => '<li>fred</li><li>barney</li>'\n\n// using the `sourceURL` option to specify a custom sourceURL for the template\nvar compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\ncompiled(data);\n// => find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector\n\n// using the `variable` option to ensure a with-statement isn't used in the compiled template\nvar compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\ncompiled.source;\n// => function(data) {\n//   var __t, __p = '';\n//   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n//   return __p;\n// }\n\n// using the `source` property to inline compiled templates for meaningful\n// line numbers in error messages and a stack trace\nfs.writeFileSync(path.join(cwd, 'jst.js'), '\\\n  var JST = {\\\n    \"main\": ' + _.template(mainText).source + '\\\n  };\\\n');\n
\n
\n
" } + "html":"

template source npm

\n
_.template([string=''], [options])
\n\n

Creates a compiled template function that can interpolate data properties\nin "interpolate" delimiters, HTML-escape interpolated data properties in\n"escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data\nproperties may be accessed as free variables in the template. If a setting\nobject is provided it takes precedence over _.templateSettings values.\n
\n
\nNote: In the development build _.template utilizes\nsourceURLs\nfor easier debugging.\n
\n
\nFor more information on precompiling templates see\nlodash's custom builds documentation.\n
\n
\nFor more information on Chrome extension sandboxes see\nChrome's extensions documentation.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The template string.

    \n
  2. \n
  3. [options] (Object)

    The options object.

    \n
  4. \n
  5. [options.escape] (RegExp)

    The HTML "escape" delimiter.

    \n
  6. \n
  7. [options.evaluate] (RegExp)

    The "evaluate" delimiter.

    \n
  8. \n
  9. [options.imports] (Object)

    An object to import into the template as free variables.

    \n
  10. \n
  11. [options.interpolate] (RegExp)

    The "interpolate" delimiter.

    \n
  12. \n
  13. [options.sourceURL] (string)

    The sourceURL of the template's compiled source.

    \n
  14. \n
  15. [options.variable] (string)

    The data object variable name.

    \n
  16. \n
\n

返回值 (Function)

\n

Returns the compiled template function.

\n
\n

示例

\n
// using the \"interpolate\" delimiter to create a compiled template\nvar compiled = _.template('hello <%= user %>!');\ncompiled({ 'user': 'fred' });\n// => 'hello fred!'\n\n// using the HTML \"escape\" delimiter to escape data property values\nvar compiled = _.template('<b><%- value %></b>');\ncompiled({ 'value': '<script>' });\n// => '<b>&lt;script&gt;</b>'\n\n// using the \"evaluate\" delimiter to execute JavaScript and generate HTML\nvar compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');\ncompiled({ 'users': ['fred', 'barney'] });\n// => '<li>fred</li><li>barney</li>'\n\n// using the internal `print` function in \"evaluate\" delimiters\nvar compiled = _.template('<% print(\"hello \" + user); %>!');\ncompiled({ 'user': 'barney' });\n// => 'hello barney!'\n\n// using the ES delimiter as an alternative to the default \"interpolate\" delimiter\nvar compiled = _.template('hello ${ user }!');\ncompiled({ 'user': 'pebbles' });\n// => 'hello pebbles!'\n\n// using custom template delimiters\n_.templateSettings.interpolate = /{{([\\s\\S]+?)}}/g;\nvar compiled = _.template('hello {{ user }}!');\ncompiled({ 'user': 'mustache' });\n// => 'hello mustache!'\n\n// using backslashes to treat delimiters as plain text\nvar compiled = _.template('<%= \"\\\\<%- value %\\\\>\" %>');\ncompiled({ 'value': 'ignored' });\n// => '<%- value %>'\n\n// using the `imports` option to import `jQuery` as `jq`\nvar text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';\nvar compiled = _.template(text, { 'imports': { 'jq': jQuery } });\ncompiled({ 'users': ['fred', 'barney'] });\n// => '<li>fred</li><li>barney</li>'\n\n// using the `sourceURL` option to specify a custom sourceURL for the template\nvar compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });\ncompiled(data);\n// => find the source of \"greeting.jst\" under the Sources tab or Resources panel of the web inspector\n\n// using the `variable` option to ensure a with-statement isn't used in the compiled template\nvar compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });\ncompiled.source;\n// => function(data) {\n//   var __t, __p = '';\n//   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';\n//   return __p;\n// }\n\n// using the `source` property to inline compiled templates for meaningful\n// line numbers in error messages and a stack trace\nfs.writeFileSync(path.join(cwd, 'jst.js'), '\\\n  var JST = {\\\n    \"main\": ' + _.template(mainText).source + '\\\n  };\\\n');\n
\n
\n
" } ,{ "href":"/toLower", - "html":"

toLower source npm

\n
_.toLower([string=''])
\n\n

Converts string, as a whole, to lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the lower cased string.

\n
\n

示例

\n
_.toLower('--Foo-Bar');\n// => '--foo-bar'\n\n_.toLower('fooBar');\n// => 'foobar'\n\n_.toLower('__FOO_BAR__');\n// => '__foo_bar__'\n
\n
\n
" } + "html":"

toLower source npm

\n
_.toLower([string=''])
\n\n

Converts string, as a whole, to lower case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the lower cased string.

\n
\n

示例

\n
_.toLower('--Foo-Bar');\n// => '--foo-bar'\n\n_.toLower('fooBar');\n// => 'foobar'\n\n_.toLower('__FOO_BAR__');\n// => '__foo_bar__'\n
\n
\n
" } ,{ "href":"/toUpper", - "html":"

toUpper source npm

\n
_.toUpper([string=''])
\n\n

Converts string, as a whole, to upper case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the upper cased string.

\n
\n

示例

\n
_.toUpper('--foo-bar');\n// => '--FOO-BAR'\n\n_.toUpper('fooBar');\n// => 'FOOBAR'\n\n_.toUpper('__foo_bar__');\n// => '__FOO_BAR__'\n
\n
\n
" } + "html":"

toUpper source npm

\n
_.toUpper([string=''])
\n\n

Converts string, as a whole, to upper case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the upper cased string.

\n
\n

示例

\n
_.toUpper('--foo-bar');\n// => '--FOO-BAR'\n\n_.toUpper('fooBar');\n// => 'FOOBAR'\n\n_.toUpper('__foo_bar__');\n// => '__FOO_BAR__'\n
\n
\n
" } ,{ "href":"/trim", - "html":"

trim source npm

\n
_.trim([string=''], [chars=whitespace])
\n\n

Removes leading and trailing whitespace or specified characters from string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to trim.

    \n
  2. \n
  3. [chars=whitespace] (string)

    The characters to trim.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the trimmed string.

\n
\n

示例

\n
_.trim('  abc  ');\n// => 'abc'\n\n_.trim('-_-abc-_-', '_-');\n// => 'abc'\n\n_.map(['  foo  ', '  bar  '], _.trim);\n// => ['foo', 'bar']\n
\n
\n
" } + "html":"

trim source npm

\n
_.trim([string=''], [chars=whitespace])
\n\n

Removes leading and trailing whitespace or specified characters from string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to trim.

    \n
  2. \n
  3. [chars=whitespace] (string)

    The characters to trim.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the trimmed string.

\n
\n

示例

\n
_.trim('  abc  ');\n// => 'abc'\n\n_.trim('-_-abc-_-', '_-');\n// => 'abc'\n\n_.map(['  foo  ', '  bar  '], _.trim);\n// => ['foo', 'bar']\n
\n
\n
" } ,{ "href":"/trimEnd", - "html":"

trimEnd source npm

\n
_.trimEnd([string=''], [chars=whitespace])
\n\n

Removes trailing whitespace or specified characters from string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to trim.

    \n
  2. \n
  3. [chars=whitespace] (string)

    The characters to trim.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the trimmed string.

\n
\n

示例

\n
_.trimEnd('  abc  ');\n// => '  abc'\n\n_.trimEnd('-_-abc-_-', '_-');\n// => '-_-abc'\n
\n
\n
" } + "html":"

trimEnd source npm

\n
_.trimEnd([string=''], [chars=whitespace])
\n\n

Removes trailing whitespace or specified characters from string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to trim.

    \n
  2. \n
  3. [chars=whitespace] (string)

    The characters to trim.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the trimmed string.

\n
\n

示例

\n
_.trimEnd('  abc  ');\n// => '  abc'\n\n_.trimEnd('-_-abc-_-', '_-');\n// => '-_-abc'\n
\n
\n
" } ,{ "href":"/trimStart", - "html":"

trimStart source npm

\n
_.trimStart([string=''], [chars=whitespace])
\n\n

Removes leading whitespace or specified characters from string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to trim.

    \n
  2. \n
  3. [chars=whitespace] (string)

    The characters to trim.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the trimmed string.

\n
\n

示例

\n
_.trimStart('  abc  ');\n// => 'abc  '\n\n_.trimStart('-_-abc-_-', '_-');\n// => 'abc-_-'\n
\n
\n
" } + "html":"

trimStart source npm

\n
_.trimStart([string=''], [chars=whitespace])
\n\n

Removes leading whitespace or specified characters from string.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to trim.

    \n
  2. \n
  3. [chars=whitespace] (string)

    The characters to trim.

    \n
  4. \n
\n

返回值 (string)

\n

Returns the trimmed string.

\n
\n

示例

\n
_.trimStart('  abc  ');\n// => 'abc  '\n\n_.trimStart('-_-abc-_-', '_-');\n// => 'abc-_-'\n
\n
\n
" } ,{ "href":"/truncate", - "html":"

truncate source npm

\n
_.truncate([string=''], [options])
\n\n

Truncates string if it's longer than the given maximum string length.\nThe last characters of the truncated string are replaced with the omission\nstring which defaults to "...".

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to truncate.

    \n
  2. \n
  3. [options] (Object)

    The options object.

    \n
  4. \n
  5. [options.length=30] (number)

    The maximum string length.

    \n
  6. \n
  7. [options.omission='...'] (string)

    The string to indicate text is omitted.

    \n
  8. \n
  9. [options.separator] (RegExp|string)

    The separator pattern to truncate to.

    \n
  10. \n
\n

返回值 (string)

\n

Returns the truncated string.

\n
\n

示例

\n
_.truncate('hi-diddly-ho there, neighborino');\n// => 'hi-diddly-ho there, neighbo...'\n\n_.truncate('hi-diddly-ho there, neighborino', {\n  'length': 24,\n  'separator': ' '\n});\n// => 'hi-diddly-ho there,...'\n\n_.truncate('hi-diddly-ho there, neighborino', {\n  'length': 24,\n  'separator': /,? +/\n});\n// => 'hi-diddly-ho there...'\n\n_.truncate('hi-diddly-ho there, neighborino', {\n  'omission': ' [...]'\n});\n// => 'hi-diddly-ho there, neig [...]'\n
\n
\n
" } + "html":"

truncate source npm

\n
_.truncate([string=''], [options])
\n\n

Truncates string if it's longer than the given maximum string length.\nThe last characters of the truncated string are replaced with the omission\nstring which defaults to "...".

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to truncate.

    \n
  2. \n
  3. [options] (Object)

    The options object.

    \n
  4. \n
  5. [options.length=30] (number)

    The maximum string length.

    \n
  6. \n
  7. [options.omission='...'] (string)

    The string to indicate text is omitted.

    \n
  8. \n
  9. [options.separator] (RegExp|string)

    The separator pattern to truncate to.

    \n
  10. \n
\n

返回值 (string)

\n

Returns the truncated string.

\n
\n

示例

\n
_.truncate('hi-diddly-ho there, neighborino');\n// => 'hi-diddly-ho there, neighbo...'\n\n_.truncate('hi-diddly-ho there, neighborino', {\n  'length': 24,\n  'separator': ' '\n});\n// => 'hi-diddly-ho there,...'\n\n_.truncate('hi-diddly-ho there, neighborino', {\n  'length': 24,\n  'separator': /,? +/\n});\n// => 'hi-diddly-ho there...'\n\n_.truncate('hi-diddly-ho there, neighborino', {\n  'omission': ' [...]'\n});\n// => 'hi-diddly-ho there, neig [...]'\n
\n
\n
" } ,{ "href":"/unescape", - "html":"

unescape source npm

\n
_.unescape([string=''])
\n\n

The inverse of _.escape; this method converts the HTML entities\n&amp;, &lt;, &gt;, &quot;, &#39;, and &#96; in string to their\ncorresponding characters.\n
\n
\nNote: No other HTML entities are unescaped. To unescape additional HTML\nentities use a third-party library like he.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to unescape.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the unescaped string.

\n
\n

示例

\n
_.unescape('fred, barney, &amp; pebbles');\n// => 'fred, barney, & pebbles'\n
\n
\n
" } + "html":"

unescape source npm

\n
_.unescape([string=''])
\n\n

The inverse of _.escape; this method converts the HTML entities\n&amp;, &lt;, &gt;, &quot;, &#39;, and &#96; in string to their\ncorresponding characters.\n
\n
\nNote: No other HTML entities are unescaped. To unescape additional HTML\nentities use a third-party library like he.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to unescape.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the unescaped string.

\n
\n

示例

\n
_.unescape('fred, barney, &amp; pebbles');\n// => 'fred, barney, & pebbles'\n
\n
\n
" } ,{ "href":"/upperCase", - "html":"

upperCase source npm

\n
_.upperCase([string=''])
\n\n

Converts string, as space separated words, to upper case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the upper cased string.

\n
\n

示例

\n
_.upperCase('--foo-bar');\n// => 'FOO BAR'\n\n_.upperCase('fooBar');\n// => 'FOO BAR'\n\n_.upperCase('__foo_bar__');\n// => 'FOO BAR'\n
\n
\n
" } + "html":"

upperCase source npm

\n
_.upperCase([string=''])
\n\n

Converts string, as space separated words, to upper case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the upper cased string.

\n
\n

示例

\n
_.upperCase('--foo-bar');\n// => 'FOO BAR'\n\n_.upperCase('fooBar');\n// => 'FOO BAR'\n\n_.upperCase('__foo_bar__');\n// => 'FOO BAR'\n
\n
\n
" } ,{ "href":"/upperFirst", - "html":"

upperFirst source npm

\n
_.upperFirst([string=''])
\n\n

Converts the first character of string to upper case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the converted string.

\n
\n

示例

\n
_.upperFirst('fred');\n// => 'Fred'\n\n_.upperFirst('FRED');\n// => 'FRED'\n
\n
\n
" } + "html":"

upperFirst source npm

\n
_.upperFirst([string=''])
\n\n

Converts the first character of string to upper case.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to convert.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the converted string.

\n
\n

示例

\n
_.upperFirst('fred');\n// => 'Fred'\n\n_.upperFirst('FRED');\n// => 'FRED'\n
\n
\n
" } ,{ "href":"/words", - "html":"

words source npm

\n
_.words([string=''], [pattern])
\n\n

Splits string into an array of its words.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to inspect.

    \n
  2. \n
  3. [pattern] (RegExp|string)

    The pattern to match words.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the words of string.

\n
\n

示例

\n
_.words('fred, barney, & pebbles');\n// => ['fred', 'barney', 'pebbles']\n\n_.words('fred, barney, & pebbles', /[^, ]+/g);\n// => ['fred', 'barney', '&', 'pebbles']\n
\n
\n
" } + "html":"

words source npm

\n
_.words([string=''], [pattern])
\n\n

Splits string into an array of its words.

\n
\n\n

参数

\n
    \n
  1. [string=''] (string)

    The string to inspect.

    \n
  2. \n
  3. [pattern] (RegExp|string)

    The pattern to match words.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the words of string.

\n
\n

示例

\n
_.words('fred, barney, & pebbles');\n// => ['fred', 'barney', 'pebbles']\n\n_.words('fred, barney, & pebbles', /[^, ]+/g);\n// => ['fred', 'barney', '&', 'pebbles']\n
\n
\n
" } ,{ "href":"/attempt", - "html":"

attempt source npm

\n
_.attempt(func)
\n\n

Attempts to invoke func, returning either the result or the caught error\nobject. Any additional arguments are provided to func when it's invoked.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to attempt.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the func result or error object.

\n
\n

示例

\n
// avoid throwing errors for invalid selectors\nvar elements = _.attempt(function(selector) {\n  return document.querySelectorAll(selector);\n}, '>_>');\n\nif (_.isError(elements)) {\n  elements = [];\n}\n
\n
\n
" } + "html":"

attempt source npm

\n
_.attempt(func)
\n\n

Attempts to invoke func, returning either the result or the caught error\nobject. Any additional arguments are provided to func when it's invoked.

\n
\n\n

参数

\n
    \n
  1. func (Function)

    The function to attempt.

    \n
  2. \n
\n

返回值 (*)

\n

Returns the func result or error object.

\n
\n

示例

\n
// avoid throwing errors for invalid selectors\nvar elements = _.attempt(function(selector) {\n  return document.querySelectorAll(selector);\n}, '>_>');\n\nif (_.isError(elements)) {\n  elements = [];\n}\n
\n
\n
" } ,{ "href":"/bindAll", - "html":"

bindAll source npm

\n
_.bindAll(object, methodNames)
\n\n

Binds methods of an object to the object itself, overwriting the existing\nmethod.\n
\n
\nNote: This method doesn't set the "length" property of bound functions.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to bind and assign the bound methods to.

    \n
  2. \n
  3. methodNames (...(string|string[])

    The object method names to bind, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
var view = {\n  'label': 'docs',\n  'onClick': function() {\n    console.log('clicked ' + this.label);\n  }\n};\n\n_.bindAll(view, 'onClick');\njQuery(element).on('click', view.onClick);\n// => logs 'clicked docs' when clicked\n
\n
\n
" } + "html":"

bindAll source npm

\n
_.bindAll(object, methodNames)
\n\n

Binds methods of an object to the object itself, overwriting the existing\nmethod.\n
\n
\nNote: This method doesn't set the "length" property of bound functions.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to bind and assign the bound methods to.

    \n
  2. \n
  3. methodNames (...(string|string[])

    The object method names to bind, specified individually or in arrays.

    \n
  4. \n
\n

返回值 (Object)

\n

Returns object.

\n
\n

示例

\n
var view = {\n  'label': 'docs',\n  'onClick': function() {\n    console.log('clicked ' + this.label);\n  }\n};\n\n_.bindAll(view, 'onClick');\njQuery(element).on('click', view.onClick);\n// => logs 'clicked docs' when clicked\n
\n
\n
" } ,{ "href":"/cond", - "html":"

cond source npm

\n
_.cond(pairs)
\n\n

Creates a function that iterates over pairs invoking the corresponding\nfunction of the first predicate to return truthy. The predicate-function\npairs are invoked with the this binding and arguments of the created\nfunction.

\n
\n\n

参数

\n
    \n
  1. pairs (Array)

    The predicate-function pairs.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.cond([\n  [_.matches({ 'a': 1 }),           _.constant('matches A')],\n  [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n  [_.constant(true),                _.constant('no match')]\n])\n\nfunc({ 'a': 1, 'b': 2 });\n// => 'matches A'\n\nfunc({ 'a': 0, 'b': 1 });\n// => 'matches B'\n\nfunc({ 'a': '1', 'b': '2' });\n// => 'no match'\n
\n
\n
" } + "html":"

cond source npm

\n
_.cond(pairs)
\n\n

Creates a function that iterates over pairs invoking the corresponding\nfunction of the first predicate to return truthy. The predicate-function\npairs are invoked with the this binding and arguments of the created\nfunction.

\n
\n\n

参数

\n
    \n
  1. pairs (Array)

    The predicate-function pairs.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.cond([\n  [_.matches({ 'a': 1 }),           _.constant('matches A')],\n  [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],\n  [_.constant(true),                _.constant('no match')]\n])\n\nfunc({ 'a': 1, 'b': 2 });\n// => 'matches A'\n\nfunc({ 'a': 0, 'b': 1 });\n// => 'matches B'\n\nfunc({ 'a': '1', 'b': '2' });\n// => 'no match'\n
\n
\n
" } ,{ "href":"/conforms", - "html":"

conforms source npm

\n
_.conforms(source)
\n\n

Creates a function that invokes the predicate properties of source with\nthe corresponding property values of a given object, returning true if\nall predicates return truthy, else false.

\n
\n\n

参数

\n
    \n
  1. source (Object)

    The object of property predicates to conform to.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n_.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));\n// => [{ 'user': 'fred', 'age': 40 }]\n
\n
\n
" } + "html":"

conforms source npm

\n
_.conforms(source)
\n\n

Creates a function that invokes the predicate properties of source with\nthe corresponding property values of a given object, returning true if\nall predicates return truthy, else false.

\n
\n\n

参数

\n
    \n
  1. source (Object)

    The object of property predicates to conform to.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n_.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));\n// => [{ 'user': 'fred', 'age': 40 }]\n
\n
\n
" } ,{ "href":"/constant", - "html":"

constant source npm

\n
_.constant(value)
\n\n

Creates a function that returns value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to return from the new function.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var object = { 'user': 'fred' };\nvar getter = _.constant(object);\n\ngetter() === object;\n// => true\n
\n
\n
" } + "html":"

constant source npm

\n
_.constant(value)
\n\n

Creates a function that returns value.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to return from the new function.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var object = { 'user': 'fred' };\nvar getter = _.constant(object);\n\ngetter() === object;\n// => true\n
\n
\n
" } ,{ "href":"/flow", - "html":"

flow source npm

\n
_.flow([funcs])
\n\n

Creates a function that returns the result of invoking the provided\nfunctions with the this binding of the created function, where each\nsuccessive invocation is supplied the return value of the previous.

\n
\n\n

参数

\n
    \n
  1. [funcs] (...(Function|Function[])

    Functions to invoke.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar addSquare = _.flow(_.add, square);\naddSquare(1, 2);\n// => 9\n
\n
\n
" } + "html":"

flow source npm

\n
_.flow([funcs])
\n\n

Creates a function that returns the result of invoking the provided\nfunctions with the this binding of the created function, where each\nsuccessive invocation is supplied the return value of the previous.

\n
\n\n

参数

\n
    \n
  1. [funcs] (...(Function|Function[])

    Functions to invoke.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar addSquare = _.flow(_.add, square);\naddSquare(1, 2);\n// => 9\n
\n
\n
" } ,{ "href":"/flowRight", - "html":"

flowRight source npm

\n
_.flowRight([funcs])
\n\n

This method is like _.flow except that it creates a function that\ninvokes the provided functions from right to left.

\n
\n\n

参数

\n
    \n
  1. [funcs] (...(Function|Function[])

    Functions to invoke.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar addSquare = _.flowRight(square, _.add);\naddSquare(1, 2);\n// => 9\n
\n
\n
" } + "html":"

flowRight source npm

\n
_.flowRight([funcs])
\n\n

This method is like _.flow except that it creates a function that\ninvokes the provided functions from right to left.

\n
\n\n

参数

\n
    \n
  1. [funcs] (...(Function|Function[])

    Functions to invoke.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
function square(n) {\n  return n * n;\n}\n\nvar addSquare = _.flowRight(square, _.add);\naddSquare(1, 2);\n// => 9\n
\n
\n
" } ,{ "href":"/identity", - "html":"

identity source npm

\n
_.identity(value)
\n\n

This method returns the first argument provided to it.

\n
\n\n

参数

\n
    \n
  1. value (*)

    Any value.

    \n
  2. \n
\n

返回值 (*)

\n

Returns value.

\n
\n

示例

\n
var object = { 'user': 'fred' };\n\n_.identity(object) === object;\n// => true\n
\n
\n
" } + "html":"

identity source npm

\n
_.identity(value)
\n\n

This method returns the first argument provided to it.

\n
\n\n

参数

\n
    \n
  1. value (*)

    Any value.

    \n
  2. \n
\n

返回值 (*)

\n

Returns value.

\n
\n

示例

\n
var object = { 'user': 'fred' };\n\n_.identity(object) === object;\n// => true\n
\n
\n
" } ,{ "href":"/iteratee", - "html":"

iteratee source npm

\n
_.iteratee([func=_.identity])
\n\n

Creates a function that invokes func with the arguments of the created\nfunction. If func is a property name the created callback returns the\nproperty value for a given element. If func is an object the created\ncallback returns true for elements that contain the equivalent object properties, otherwise it returns false.

\n
\n\n

参数

\n
    \n
  1. [func=_.identity] (*)

    The value to convert to a callback.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the callback.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n// wrap to create custom callback shorthands\n_.iteratee = _.wrap(_.iteratee, function(callback, func, thisArg) {\n  var match = /^(.+?)__([gl]t)(.+)$/.exec(func);\n  if (!match) {\n    return callback(func, thisArg);\n  }\n  return function(object) {\n    return match[2] == 'gt'\n      ? object[match[1]] > match[3]\n      : object[match[1]] < match[3];\n  };\n});\n\n_.filter(users, 'age__gt36');\n// => [{ 'user': 'fred', 'age': 40 }]\n
\n
\n
" } + "html":"

iteratee source npm

\n
_.iteratee([func=_.identity])
\n\n

Creates a function that invokes func with the arguments of the created\nfunction. If func is a property name the created callback returns the\nproperty value for a given element. If func is an object the created\ncallback returns true for elements that contain the equivalent object properties, otherwise it returns false.

\n
\n\n

参数

\n
    \n
  1. [func=_.identity] (*)

    The value to convert to a callback.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the callback.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36 },\n  { 'user': 'fred',   'age': 40 }\n];\n\n// wrap to create custom callback shorthands\n_.iteratee = _.wrap(_.iteratee, function(callback, func, thisArg) {\n  var match = /^(.+?)__([gl]t)(.+)$/.exec(func);\n  if (!match) {\n    return callback(func, thisArg);\n  }\n  return function(object) {\n    return match[2] == 'gt'\n      ? object[match[1]] > match[3]\n      : object[match[1]] < match[3];\n  };\n});\n\n_.filter(users, 'age__gt36');\n// => [{ 'user': 'fred', 'age': 40 }]\n
\n
\n
" } ,{ "href":"/matches", - "html":"

matches source npm

\n
_.matches(source)
\n\n

Creates a function that performs a deep partial comparison between a given\nobject and source, returning true if the given object has equivalent\nproperty values, else false.\n
\n
\nNote: This method supports comparing the same values as _.isEqual.

\n
\n\n

参数

\n
    \n
  1. source (Object)

    The object of property values to match.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36, 'active': true },\n  { 'user': 'fred',   'age': 40, 'active': false }\n];\n\n_.filter(users, _.matches({ 'age': 40, 'active': false }));\n// => [{ 'user': 'fred', 'age': 40, 'active': false }]\n
\n
\n
" } + "html":"

matches source npm

\n
_.matches(source)
\n\n

Creates a function that performs a deep partial comparison between a given\nobject and source, returning true if the given object has equivalent\nproperty values, else false.\n
\n
\nNote: This method supports comparing the same values as _.isEqual.

\n
\n\n

参数

\n
    \n
  1. source (Object)

    The object of property values to match.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney', 'age': 36, 'active': true },\n  { 'user': 'fred',   'age': 40, 'active': false }\n];\n\n_.filter(users, _.matches({ 'age': 40, 'active': false }));\n// => [{ 'user': 'fred', 'age': 40, 'active': false }]\n
\n
\n
" } ,{ "href":"/matchesProperty", - "html":"

matchesProperty source npm

\n
_.matchesProperty(path, srcValue)
\n\n

Creates a function that performs a deep partial comparison between the\nvalue at path of a given object to srcValue, returning true if the\nobject value is equivalent, else false.\n
\n
\nNote: This method supports comparing the same values as _.isEqual.

\n
\n\n

参数

\n
    \n
  1. path (Array|string)

    The path of the property to get.

    \n
  2. \n
  3. srcValue (*)

    The value to match.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\n_.find(users, _.matchesProperty('user', 'fred'));\n// => { 'user': 'fred' }\n
\n
\n
" } + "html":"

matchesProperty source npm

\n
_.matchesProperty(path, srcValue)
\n\n

Creates a function that performs a deep partial comparison between the\nvalue at path of a given object to srcValue, returning true if the\nobject value is equivalent, else false.\n
\n
\nNote: This method supports comparing the same values as _.isEqual.

\n
\n\n

参数

\n
    \n
  1. path (Array|string)

    The path of the property to get.

    \n
  2. \n
  3. srcValue (*)

    The value to match.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var users = [\n  { 'user': 'barney' },\n  { 'user': 'fred' }\n];\n\n_.find(users, _.matchesProperty('user', 'fred'));\n// => { 'user': 'fred' }\n
\n
\n
" } ,{ "href":"/method", - "html":"

method source npm

\n
_.method(path, [args])
\n\n

Creates a function that invokes the method at path of a given object.\nAny additional arguments are provided to the invoked method.

\n
\n\n

参数

\n
    \n
  1. path (Array|string)

    The path of the method to invoke.

    \n
  2. \n
  3. [args] (...*)

    The arguments to invoke the method with.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var objects = [\n  { 'a': { 'b': { 'c': _.constant(2) } } },\n  { 'a': { 'b': { 'c': _.constant(1) } } }\n];\n\n_.map(objects, _.method('a.b.c'));\n// => [2, 1]\n\n_.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');\n// => [1, 2]\n
\n
\n
" } + "html":"

method source npm

\n
_.method(path, [args])
\n\n

Creates a function that invokes the method at path of a given object.\nAny additional arguments are provided to the invoked method.

\n
\n\n

参数

\n
    \n
  1. path (Array|string)

    The path of the method to invoke.

    \n
  2. \n
  3. [args] (...*)

    The arguments to invoke the method with.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var objects = [\n  { 'a': { 'b': { 'c': _.constant(2) } } },\n  { 'a': { 'b': { 'c': _.constant(1) } } }\n];\n\n_.map(objects, _.method('a.b.c'));\n// => [2, 1]\n\n_.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');\n// => [1, 2]\n
\n
\n
" } ,{ "href":"/methodOf", - "html":"

methodOf source npm

\n
_.methodOf(object, [args])
\n\n

The opposite of _.method; this method creates a function that invokes\nthe method at a given path of object. Any additional arguments are\nprovided to the invoked method.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. [args] (...*)

    The arguments to invoke the method with.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var array = _.times(3, _.constant),\n    object = { 'a': array, 'b': array, 'c': array };\n\n_.map(['a[2]', 'c[0]'], _.methodOf(object));\n// => [2, 0]\n\n_.map([['a', '2'], ['c', '0']], _.methodOf(object));\n// => [2, 0]\n
\n
\n
" } + "html":"

methodOf source npm

\n
_.methodOf(object, [args])
\n\n

The opposite of _.method; this method creates a function that invokes\nthe method at a given path of object. Any additional arguments are\nprovided to the invoked method.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
  3. [args] (...*)

    The arguments to invoke the method with.

    \n
  4. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var array = _.times(3, _.constant),\n    object = { 'a': array, 'b': array, 'c': array };\n\n_.map(['a[2]', 'c[0]'], _.methodOf(object));\n// => [2, 0]\n\n_.map([['a', '2'], ['c', '0']], _.methodOf(object));\n// => [2, 0]\n
\n
\n
" } ,{ "href":"/mixin", - "html":"

mixin source npm

\n
_.mixin([object=lodash], source, [options])
\n\n

Adds all own enumerable function properties of a source object to the\ndestination object. If object is a function then methods are added to\nits prototype as well.\n
\n
\nNote: Use _.runInContext to create a pristine lodash function to\navoid conflicts caused by modifying the original.

\n
\n\n

参数

\n
    \n
  1. [object=lodash] (Function|Object)

    The destination object.

    \n
  2. \n
  3. source (Object)

    The object of functions to add.

    \n
  4. \n
  5. [options] (Object)

    The options object.

    \n
  6. \n
  7. [options.chain=true] (boolean)

    Specify whether the functions added are chainable.

    \n
  8. \n
\n

返回值 (Function|Object)

\n

Returns object.

\n
\n

示例

\n
function vowels(string) {\n  return _.filter(string, function(v) {\n    return /[aeiou]/i.test(v);\n  });\n}\n\n_.mixin({ 'vowels': vowels });\n_.vowels('fred');\n// => ['e']\n\n_('fred').vowels().value();\n// => ['e']\n\n_.mixin({ 'vowels': vowels }, { 'chain': false });\n_('fred').vowels();\n// => ['e']\n
\n
\n
" } + "html":"

mixin source npm

\n
_.mixin([object=lodash], source, [options])
\n\n

Adds all own enumerable function properties of a source object to the\ndestination object. If object is a function then methods are added to\nits prototype as well.\n
\n
\nNote: Use _.runInContext to create a pristine lodash function to\navoid conflicts caused by modifying the original.

\n
\n\n

参数

\n
    \n
  1. [object=lodash] (Function|Object)

    The destination object.

    \n
  2. \n
  3. source (Object)

    The object of functions to add.

    \n
  4. \n
  5. [options] (Object)

    The options object.

    \n
  6. \n
  7. [options.chain=true] (boolean)

    Specify whether the functions added are chainable.

    \n
  8. \n
\n

返回值 (Function|Object)

\n

Returns object.

\n
\n

示例

\n
function vowels(string) {\n  return _.filter(string, function(v) {\n    return /[aeiou]/i.test(v);\n  });\n}\n\n_.mixin({ 'vowels': vowels });\n_.vowels('fred');\n// => ['e']\n\n_('fred').vowels().value();\n// => ['e']\n\n_.mixin({ 'vowels': vowels }, { 'chain': false });\n_('fred').vowels();\n// => ['e']\n
\n
\n
" } ,{ "href":"/noConflict", - "html":"

noConflict source npm

\n
_.noConflict()
\n\n

Reverts the _ variable to its previous value and returns a reference to\nthe lodash function.

\n
\n\n

返回值 (Function)

\n

Returns the lodash function.

\n
\n

示例

\n
var lodash = _.noConflict();\n
\n
\n
" } + "html":"

noConflict source npm

\n
_.noConflict()
\n\n

Reverts the _ variable to its previous value and returns a reference to\nthe lodash function.

\n
\n\n

返回值 (Function)

\n

Returns the lodash function.

\n
\n

示例

\n
var lodash = _.noConflict();\n
\n
\n
" } ,{ "href":"/noop", - "html":"

noop source npm

\n
_.noop()
\n\n

A no-operation function that returns undefined regardless of the\narguments it receives.

\n
\n\n

示例

\n
var object = { 'user': 'fred' };\n\n_.noop(object) === undefined;\n// => true\n
\n
\n
" } + "html":"

noop source npm

\n
_.noop()
\n\n

A no-operation function that returns undefined regardless of the\narguments it receives.

\n
\n\n

示例

\n
var object = { 'user': 'fred' };\n\n_.noop(object) === undefined;\n// => true\n
\n
\n
" } ,{ "href":"/nthArg", - "html":"

nthArg source npm

\n
_.nthArg([n=0])
\n\n

Creates a function that returns its nth argument.

\n
\n\n

参数

\n
    \n
  1. [n=0] (number)

    The index of the argument to return.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.nthArg(1);\n\nfunc('a', 'b', 'c');\n// => 'b'\n
\n
\n
" } + "html":"

nthArg source npm

\n
_.nthArg([n=0])
\n\n

Creates a function that returns its nth argument.

\n
\n\n

参数

\n
    \n
  1. [n=0] (number)

    The index of the argument to return.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.nthArg(1);\n\nfunc('a', 'b', 'c');\n// => 'b'\n
\n
\n
" } ,{ "href":"/over", - "html":"

over source npm

\n
_.over(iteratees)
\n\n

Creates a function that invokes iteratees with the arguments provided\nto the created function and returns their results.

\n
\n\n

参数

\n
    \n
  1. iteratees (...(Function|Function[])

    The iteratees to invoke.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.over(Math.max, Math.min);\n\nfunc(1, 2, 3, 4);\n// => [4, 1]\n
\n
\n
" } + "html":"

over source npm

\n
_.over(iteratees)
\n\n

Creates a function that invokes iteratees with the arguments provided\nto the created function and returns their results.

\n
\n\n

参数

\n
    \n
  1. iteratees (...(Function|Function[])

    The iteratees to invoke.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.over(Math.max, Math.min);\n\nfunc(1, 2, 3, 4);\n// => [4, 1]\n
\n
\n
" } ,{ "href":"/overEvery", - "html":"

overEvery source npm

\n
_.overEvery(predicates)
\n\n

Creates a function that checks if all of the predicates return\ntruthy when invoked with the arguments provided to the created function.

\n
\n\n

参数

\n
    \n
  1. predicates (...(Function|Function[])

    The predicates to check.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.overEvery(Boolean, isFinite);\n\nfunc('1');\n// => true\n\nfunc(null);\n// => false\n\nfunc(NaN);\n// => false\n
\n
\n
" } + "html":"

overEvery source npm

\n
_.overEvery(predicates)
\n\n

Creates a function that checks if all of the predicates return\ntruthy when invoked with the arguments provided to the created function.

\n
\n\n

参数

\n
    \n
  1. predicates (...(Function|Function[])

    The predicates to check.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.overEvery(Boolean, isFinite);\n\nfunc('1');\n// => true\n\nfunc(null);\n// => false\n\nfunc(NaN);\n// => false\n
\n
\n
" } ,{ "href":"/overSome", - "html":"

overSome source npm

\n
_.overSome(predicates)
\n\n

Creates a function that checks if any of the predicates return\ntruthy when invoked with the arguments provided to the created function.

\n
\n\n

参数

\n
    \n
  1. predicates (...(Function|Function[])

    The predicates to check.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.overSome(Boolean, isFinite);\n\nfunc('1');\n// => true\n\nfunc(null);\n// => true\n\nfunc(NaN);\n// => false\n
\n
\n
" } + "html":"

overSome source npm

\n
_.overSome(predicates)
\n\n

Creates a function that checks if any of the predicates return\ntruthy when invoked with the arguments provided to the created function.

\n
\n\n

参数

\n
    \n
  1. predicates (...(Function|Function[])

    The predicates to check.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var func = _.overSome(Boolean, isFinite);\n\nfunc('1');\n// => true\n\nfunc(null);\n// => true\n\nfunc(NaN);\n// => false\n
\n
\n
" } ,{ "href":"/property", - "html":"

property source npm

\n
_.property(path)
\n\n

Creates a function that returns the value at path of a given object.

\n
\n\n

参数

\n
    \n
  1. path (Array|string)

    The path of the property to get.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var objects = [\n  { 'a': { 'b': { 'c': 2 } } },\n  { 'a': { 'b': { 'c': 1 } } }\n];\n\n_.map(objects, _.property('a.b.c'));\n// => [2, 1]\n\n_.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n// => [1, 2]\n
\n
\n
" } + "html":"

property source npm

\n
_.property(path)
\n\n

Creates a function that returns the value at path of a given object.

\n
\n\n

参数

\n
    \n
  1. path (Array|string)

    The path of the property to get.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var objects = [\n  { 'a': { 'b': { 'c': 2 } } },\n  { 'a': { 'b': { 'c': 1 } } }\n];\n\n_.map(objects, _.property('a.b.c'));\n// => [2, 1]\n\n_.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');\n// => [1, 2]\n
\n
\n
" } ,{ "href":"/propertyOf", - "html":"

propertyOf source npm

\n
_.propertyOf(object)
\n\n

The opposite of _.property; this method creates a function that returns\nthe value at a given path of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var array = [0, 1, 2],\n    object = { 'a': array, 'b': array, 'c': array };\n\n_.map(['a[2]', 'c[0]'], _.propertyOf(object));\n// => [2, 0]\n\n_.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n// => [2, 0]\n
\n
\n
" } + "html":"

propertyOf source npm

\n
_.propertyOf(object)
\n\n

The opposite of _.property; this method creates a function that returns\nthe value at a given path of object.

\n
\n\n

参数

\n
    \n
  1. object (Object)

    The object to query.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns the new function.

\n
\n

示例

\n
var array = [0, 1, 2],\n    object = { 'a': array, 'b': array, 'c': array };\n\n_.map(['a[2]', 'c[0]'], _.propertyOf(object));\n// => [2, 0]\n\n_.map([['a', '2'], ['c', '0']], _.propertyOf(object));\n// => [2, 0]\n
\n
\n
" } ,{ "href":"/range", - "html":"

range source npm

\n
_.range([start=0], end, [step=1])
\n\n

Creates an array of numbers (positive and/or negative) progressing from\nstart up to, but not including, end. A step of -1 is used if a negative\nstart is specified without an end or step. If end is not specified\nit's set to start with start then set to 0. If end is less than\nstart a zero-length range is created unless a negative step is specified.\n
\n
\nNote: JavaScript follows the IEEE-754 standard for resolving\nfloating-point values which can produce unexpected results.

\n
\n\n

参数

\n
    \n
  1. [start=0] (number)

    The start of the range.

    \n
  2. \n
  3. end (number)

    The end of the range.

    \n
  4. \n
  5. [step=1] (number)

    The value to increment or decrement by.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of numbers.

\n
\n

示例

\n
_.range(4);\n// => [0, 1, 2, 3]\n\n_.range(-4);\n// => [0, -1, -2, -3]\n\n_.range(1, 5);\n// => [1, 2, 3, 4]\n\n_.range(0, 20, 5);\n// => [0, 5, 10, 15]\n\n_.range(0, -4, -1);\n// => [0, -1, -2, -3]\n\n_.range(1, 4, 0);\n// => [1, 1, 1]\n\n_.range(0);\n// => []\n
\n
\n
" } + "html":"

range source npm

\n
_.range([start=0], end, [step=1])
\n\n

Creates an array of numbers (positive and/or negative) progressing from\nstart up to, but not including, end. A step of -1 is used if a negative\nstart is specified without an end or step. If end is not specified\nit's set to start with start then set to 0. If end is less than\nstart a zero-length range is created unless a negative step is specified.\n
\n
\nNote: JavaScript follows the IEEE-754 standard for resolving\nfloating-point values which can produce unexpected results.

\n
\n\n

参数

\n
    \n
  1. [start=0] (number)

    The start of the range.

    \n
  2. \n
  3. end (number)

    The end of the range.

    \n
  4. \n
  5. [step=1] (number)

    The value to increment or decrement by.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of numbers.

\n
\n

示例

\n
_.range(4);\n// => [0, 1, 2, 3]\n\n_.range(-4);\n// => [0, -1, -2, -3]\n\n_.range(1, 5);\n// => [1, 2, 3, 4]\n\n_.range(0, 20, 5);\n// => [0, 5, 10, 15]\n\n_.range(0, -4, -1);\n// => [0, -1, -2, -3]\n\n_.range(1, 4, 0);\n// => [1, 1, 1]\n\n_.range(0);\n// => []\n
\n
\n
" } ,{ "href":"/rangeRight", - "html":"

rangeRight source npm

\n
_.rangeRight([start=0], end, [step=1])
\n\n

This method is like _.range except that it populates values in\ndescending order.

\n
\n\n

参数

\n
    \n
  1. [start=0] (number)

    The start of the range.

    \n
  2. \n
  3. end (number)

    The end of the range.

    \n
  4. \n
  5. [step=1] (number)

    The value to increment or decrement by.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of numbers.

\n
\n

示例

\n
_.rangeRight(4);\n// => [3, 2, 1, 0]\n\n_.rangeRight(-4);\n// => [-3, -2, -1, 0]\n\n_.rangeRight(1, 5);\n// => [4, 3, 2, 1]\n\n_.rangeRight(0, 20, 5);\n// => [15, 10, 5, 0]\n\n_.rangeRight(0, -4, -1);\n// => [-3, -2, -1, 0]\n\n_.rangeRight(1, 4, 0);\n// => [1, 1, 1]\n\n_.rangeRight(0);\n// => []\n
\n
\n
" } + "html":"

rangeRight source npm

\n
_.rangeRight([start=0], end, [step=1])
\n\n

This method is like _.range except that it populates values in\ndescending order.

\n
\n\n

参数

\n
    \n
  1. [start=0] (number)

    The start of the range.

    \n
  2. \n
  3. end (number)

    The end of the range.

    \n
  4. \n
  5. [step=1] (number)

    The value to increment or decrement by.

    \n
  6. \n
\n

返回值 (Array)

\n

Returns the new array of numbers.

\n
\n

示例

\n
_.rangeRight(4);\n// => [3, 2, 1, 0]\n\n_.rangeRight(-4);\n// => [-3, -2, -1, 0]\n\n_.rangeRight(1, 5);\n// => [4, 3, 2, 1]\n\n_.rangeRight(0, 20, 5);\n// => [15, 10, 5, 0]\n\n_.rangeRight(0, -4, -1);\n// => [-3, -2, -1, 0]\n\n_.rangeRight(1, 4, 0);\n// => [1, 1, 1]\n\n_.rangeRight(0);\n// => []\n
\n
\n
" } ,{ "href":"/runInContext", - "html":"

runInContext source npm

\n
_.runInContext([context=root])
\n\n

Create a new pristine lodash function using the context object.

\n
\n\n

参数

\n
    \n
  1. [context=root] (Object)

    The context object.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns a new lodash function.

\n
\n

示例

\n
_.mixin({ 'foo': _.constant('foo') });\n\nvar lodash = _.runInContext();\nlodash.mixin({ 'bar': lodash.constant('bar') });\n\n_.isFunction(_.foo);\n// => true\n_.isFunction(_.bar);\n// => false\n\nlodash.isFunction(lodash.foo);\n// => false\nlodash.isFunction(lodash.bar);\n// => true\n\n// using `context` to mock `Date#getTime` use in `_.now`\nvar mock = _.runInContext({\n  'Date': function() {\n    return { 'getTime': getTimeMock };\n  }\n});\n\n// or creating a suped-up `defer` in Node.js\nvar defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n
\n
\n
" } + "html":"

runInContext source npm

\n
_.runInContext([context=root])
\n\n

Create a new pristine lodash function using the context object.

\n
\n\n

参数

\n
    \n
  1. [context=root] (Object)

    The context object.

    \n
  2. \n
\n

返回值 (Function)

\n

Returns a new lodash function.

\n
\n

示例

\n
_.mixin({ 'foo': _.constant('foo') });\n\nvar lodash = _.runInContext();\nlodash.mixin({ 'bar': lodash.constant('bar') });\n\n_.isFunction(_.foo);\n// => true\n_.isFunction(_.bar);\n// => false\n\nlodash.isFunction(lodash.foo);\n// => false\nlodash.isFunction(lodash.bar);\n// => true\n\n// using `context` to mock `Date#getTime` use in `_.now`\nvar mock = _.runInContext({\n  'Date': function() {\n    return { 'getTime': getTimeMock };\n  }\n});\n\n// or creating a suped-up `defer` in Node.js\nvar defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n
\n
\n
" } ,{ "href":"/times", - "html":"

times source npm

\n
_.times(n, [iteratee=_.identity])
\n\n

Invokes the iteratee function n times, returning an array of the results\nof each invocation. The iteratee is invoked with one argument; (index).

\n
\n\n

参数

\n
    \n
  1. n (number)

    The number of times to invoke iteratee.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the array of results.

\n
\n

示例

\n
_.times(3, String);\n// => ['0', '1', '2']\n\n _.times(4, _.constant(true));\n// => [true, true, true, true]\n
\n
\n
" } + "html":"

times source npm

\n
_.times(n, [iteratee=_.identity])
\n\n

Invokes the iteratee function n times, returning an array of the results\nof each invocation. The iteratee is invoked with one argument; (index).

\n
\n\n

参数

\n
    \n
  1. n (number)

    The number of times to invoke iteratee.

    \n
  2. \n
  3. [iteratee=_.identity] (Function)

    The function invoked per iteration.

    \n
  4. \n
\n

返回值 (Array)

\n

Returns the array of results.

\n
\n

示例

\n
_.times(3, String);\n// => ['0', '1', '2']\n\n _.times(4, _.constant(true));\n// => [true, true, true, true]\n
\n
\n
" } ,{ "href":"/toPath", - "html":"

toPath source npm

\n
_.toPath(value)
\n\n

Converts value to a property path array.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new property path array.

\n
\n

示例

\n
_.toPath('a.b.c');\n// => ['a', 'b', 'c']\n\n_.toPath('a[0].b.c');\n// => ['a', '0', 'b', 'c']\n\nvar path = ['a', 'b', 'c'],\n    newPath = _.toPath(path);\n\nconsole.log(newPath);\n// => ['a', 'b', 'c']\n\nconsole.log(path === newPath);\n// => false\n
\n
\n
" } + "html":"

toPath source npm

\n
_.toPath(value)
\n\n

Converts value to a property path array.

\n
\n\n

参数

\n
    \n
  1. value (*)

    The value to convert.

    \n
  2. \n
\n

返回值 (Array)

\n

Returns the new property path array.

\n
\n

示例

\n
_.toPath('a.b.c');\n// => ['a', 'b', 'c']\n\n_.toPath('a[0].b.c');\n// => ['a', '0', 'b', 'c']\n\nvar path = ['a', 'b', 'c'],\n    newPath = _.toPath(path);\n\nconsole.log(newPath);\n// => ['a', 'b', 'c']\n\nconsole.log(path === newPath);\n// => false\n
\n
\n
" } ,{ "href":"/uniqueId", - "html":"

uniqueId source npm

\n
_.uniqueId([prefix])
\n\n

Generates a unique ID. If prefix is provided the ID is appended to it.

\n
\n\n

参数

\n
    \n
  1. [prefix] (string)

    The value to prefix the ID with.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the unique ID.

\n
\n

示例

\n
_.uniqueId('contact_');\n// => 'contact_104'\n\n_.uniqueId();\n// => '105'\n
\n
\n
" } + "html":"

uniqueId source npm

\n
_.uniqueId([prefix])
\n\n

Generates a unique ID. If prefix is provided the ID is appended to it.

\n
\n\n

参数

\n
    \n
  1. [prefix] (string)

    The value to prefix the ID with.

    \n
  2. \n
\n

返回值 (string)

\n

Returns the unique ID.

\n
\n

示例

\n
_.uniqueId('contact_');\n// => 'contact_104'\n\n_.uniqueId();\n// => '105'\n
\n
\n
" } ] \ No newline at end of file diff --git a/parseInt.html b/parseInt.html index 292174a..3b46b11 100644 --- a/parseInt.html +++ b/parseInt.html @@ -392,7 +392,7 @@
-

parseInt source npm

+

parseInt source npm

_.parseInt(string, [radix])

Converts string to an integer of the specified radix. If radix is diff --git a/partial.html b/partial.html index fc0386e..caf7e0e 100644 --- a/partial.html +++ b/partial.html @@ -392,7 +392,7 @@

-

partial source npm

+

partial source npm

_.partial(func, [partials])

Creates a function that invokes func with partial arguments prepended diff --git a/partialRight.html b/partialRight.html index c2cbe64..574d93d 100644 --- a/partialRight.html +++ b/partialRight.html @@ -392,7 +392,7 @@

-

partialRight source npm

+

partialRight source npm

_.partialRight(func, [partials])

This method is like _.partial except that partially applied arguments diff --git a/partition.html b/partition.html index 6d008b2..d581cc7 100644 --- a/partition.html +++ b/partition.html @@ -392,7 +392,7 @@

-

partition source npm

+

partition source npm

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

Creates an array of elements split into two groups, the first of which diff --git a/pick.html b/pick.html index 033333c..a144630 100644 --- a/pick.html +++ b/pick.html @@ -392,7 +392,7 @@

-

pick source npm

+

pick source npm

_.pick(object, [props])

Creates an object composed of the picked object properties.

diff --git a/pickBy.html b/pickBy.html index b0404a2..1a1e229 100644 --- a/pickBy.html +++ b/pickBy.html @@ -392,7 +392,7 @@
-

pickBy source npm

+

pickBy source npm

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

Creates an object composed of the object properties predicate returns diff --git a/property.html b/property.html index 1ded47c..103fed8 100644 --- a/property.html +++ b/property.html @@ -392,7 +392,7 @@

-

property source npm

+

property source npm

_.property(path)

Creates a function that returns the value at path of a given object.

diff --git a/propertyOf.html b/propertyOf.html index 4ccb5b2..79f62b1 100644 --- a/propertyOf.html +++ b/propertyOf.html @@ -392,7 +392,7 @@
-

propertyOf source npm

+

propertyOf source npm

_.propertyOf(object)

The opposite of _.property; this method creates a function that returns diff --git a/prototype-Symbol-iterator.html b/prototype-Symbol-iterator.html index a95f5c6..813ed12 100644 --- a/prototype-Symbol-iterator.html +++ b/prototype-Symbol-iterator.html @@ -392,7 +392,7 @@

-

prototype.Symbol.iterator source

+

prototype.Symbol.iterator source

_.prototype.Symbol.iterator()

Enables the wrapper to be iterable.

diff --git a/prototype-at.html b/prototype-at.html index 9786fc2..5df9939 100644 --- a/prototype-at.html +++ b/prototype-at.html @@ -392,7 +392,7 @@
-

prototype.at source

+

prototype.at source

_.prototype.at([paths])

This method is the wrapper version of _.at.

diff --git a/prototype-chain.html b/prototype-chain.html index eea544d..edf6254 100644 --- a/prototype-chain.html +++ b/prototype-chain.html @@ -392,7 +392,7 @@
-

prototype.chain source

+

prototype.chain source

_.prototype.chain()

Enables explicit method chaining on the wrapper object.

diff --git a/prototype-commit.html b/prototype-commit.html index b5ecafa..d5da47c 100644 --- a/prototype-commit.html +++ b/prototype-commit.html @@ -392,7 +392,7 @@
-

prototype.commit source

+

prototype.commit source

_.prototype.commit()

Executes the chained sequence and returns the wrapped result.

diff --git a/prototype-next.html b/prototype-next.html index 9c987a9..2f2edfb 100644 --- a/prototype-next.html +++ b/prototype-next.html @@ -392,7 +392,7 @@
-

prototype.next source

+

prototype.next source

_.prototype.next()

Gets the next value on a wrapped object following the diff --git a/prototype-plant.html b/prototype-plant.html index 22be4c7..5f36d2c 100644 --- a/prototype-plant.html +++ b/prototype-plant.html @@ -392,7 +392,7 @@

-

prototype.plant source

+

prototype.plant source

_.prototype.plant(value)

Creates a clone of the chained sequence planting value as the wrapped value.

diff --git a/prototype-reverse.html b/prototype-reverse.html index 6d78f26..fb28cf2 100644 --- a/prototype-reverse.html +++ b/prototype-reverse.html @@ -392,7 +392,7 @@
-

prototype.reverse source npm

+

prototype.reverse source npm

_.prototype.reverse()

Reverses array so that the first element becomes the last, the second diff --git a/prototype-value.html b/prototype-value.html index 3eb9584..3c20529 100644 --- a/prototype-value.html +++ b/prototype-value.html @@ -392,7 +392,7 @@

-

prototype.value run, toJSON, valueOf source

+

prototype.value run, toJSON, valueOf source

_.prototype.value()

Executes the chained sequence to extract the unwrapped value.

diff --git a/pull.html b/pull.html index bef7c92..bace5bb 100644 --- a/pull.html +++ b/pull.html @@ -392,7 +392,7 @@
-

pull source npm

+

pull source npm

_.pull(array, [values])

Removes all provided values from array using diff --git a/pullAll.html b/pullAll.html index dd86c58..1bc40d3 100644 --- a/pullAll.html +++ b/pullAll.html @@ -392,7 +392,7 @@

-

pullAll source npm

+

pullAll source npm

_.pullAll(array, values)

This method is like _.pull except that it accepts an array of values to remove. diff --git a/pullAllBy.html b/pullAllBy.html index ba23ad5..144ba07 100644 --- a/pullAllBy.html +++ b/pullAllBy.html @@ -392,7 +392,7 @@

-

pullAllBy source npm

+

pullAllBy source npm

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

This method is like _.pullAll except that it accepts iteratee which is diff --git a/pullAt.html b/pullAt.html index 7091b0b..26fe7d4 100644 --- a/pullAt.html +++ b/pullAt.html @@ -392,7 +392,7 @@

-

pullAt source npm

+

pullAt source npm

_.pullAt(array, [indexes])

Removes elements from array corresponding to indexes and returns an diff --git a/random.html b/random.html index 3a754a0..f7230e0 100644 --- a/random.html +++ b/random.html @@ -392,7 +392,7 @@

-

random source npm

+

random source npm

_.random([min=0], [max=1], [floating])

Produces a random number between min and max (inclusive). If only one diff --git a/range.html b/range.html index 3df02ff..8c45145 100644 --- a/range.html +++ b/range.html @@ -392,7 +392,7 @@

-

range source npm

+

range source npm

_.range([start=0], end, [step=1])

Creates an array of numbers (positive and/or negative) progressing from diff --git a/rangeRight.html b/rangeRight.html index 2a374dd..79bd5d5 100644 --- a/rangeRight.html +++ b/rangeRight.html @@ -392,7 +392,7 @@

-

rangeRight source npm

+

rangeRight source npm

_.rangeRight([start=0], end, [step=1])

This method is like _.range except that it populates values in diff --git a/rearg.html b/rearg.html index 1add710..8d70903 100644 --- a/rearg.html +++ b/rearg.html @@ -392,7 +392,7 @@

-

rearg source npm

+

rearg source npm

_.rearg(func, indexes)

Creates a function that invokes func with arguments arranged according diff --git a/reduce.html b/reduce.html index 78216d4..c7da471 100644 --- a/reduce.html +++ b/reduce.html @@ -392,7 +392,7 @@

-

reduce source npm

+

reduce source npm

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

Reduces collection to a value which is the accumulated result of running diff --git a/reduceRight.html b/reduceRight.html index 84b5d68..f2e1092 100644 --- a/reduceRight.html +++ b/reduceRight.html @@ -392,7 +392,7 @@

-

reduceRight source npm

+

reduceRight source npm

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

This method is like _.reduce except that it iterates over elements of diff --git a/reject.html b/reject.html index 3c64feb..2520ce4 100644 --- a/reject.html +++ b/reject.html @@ -392,7 +392,7 @@

-

reject source npm

+

reject source npm

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

The opposite of _.filter; this method returns the elements of collection diff --git a/remove.html b/remove.html index 3401070..5e6f140 100644 --- a/remove.html +++ b/remove.html @@ -392,7 +392,7 @@

-

remove source npm

+

remove source npm

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

Removes all elements from array that predicate returns truthy for diff --git a/repeat.html b/repeat.html index 93fe883..21c9107 100644 --- a/repeat.html +++ b/repeat.html @@ -392,7 +392,7 @@

-

repeat source npm

+

repeat source npm

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

Repeats the given string n times.

diff --git a/replace.html b/replace.html index 84d45a0..0929dc2 100644 --- a/replace.html +++ b/replace.html @@ -392,7 +392,7 @@
-

replace source npm

+

replace source npm

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

Replaces matches for pattern in string with replacement. diff --git a/rest.html b/rest.html index ba04c27..39abf02 100644 --- a/rest.html +++ b/rest.html @@ -392,7 +392,7 @@

-

rest source npm

+

rest source npm

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

Creates a function that invokes func with the this binding of the diff --git a/result.html b/result.html index aa505c5..ca55453 100644 --- a/result.html +++ b/result.html @@ -392,7 +392,7 @@

-

result source npm

+

result source npm

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

This method is like _.get except that if the resolved value is a function diff --git a/round.html b/round.html index 0707093..dd94711 100644 --- a/round.html +++ b/round.html @@ -392,7 +392,7 @@

-

round source npm

+

round source npm

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

Computes number rounded to precision.

diff --git a/runInContext.html b/runInContext.html index aff6884..7de0770 100644 --- a/runInContext.html +++ b/runInContext.html @@ -392,7 +392,7 @@
-

runInContext source npm

+

runInContext source npm

_.runInContext([context=root])

Create a new pristine lodash function using the context object.

diff --git a/sample.html b/sample.html index b78d268..5de5e25 100644 --- a/sample.html +++ b/sample.html @@ -392,7 +392,7 @@
-

sample source npm

+

sample source npm

_.sample(collection)

Gets a random element from collection.

diff --git a/sampleSize.html b/sampleSize.html index 538052b..0875d08 100644 --- a/sampleSize.html +++ b/sampleSize.html @@ -392,7 +392,7 @@
-

sampleSize source npm

+

sampleSize source npm

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

Gets n random elements from collection.

diff --git a/set.html b/set.html index 567121b..e0b84c1 100644 --- a/set.html +++ b/set.html @@ -392,7 +392,7 @@
-

set source npm

+

set source npm

_.set(object, path, value)

Sets the value at path of object. If a portion of path doesn't exist diff --git a/setWith.html b/setWith.html index 86b11e1..0bffa20 100644 --- a/setWith.html +++ b/setWith.html @@ -392,7 +392,7 @@

-

setWith source npm

+

setWith source npm

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

This method is like _.set except that it accepts customizer which is diff --git a/shuffle.html b/shuffle.html index decb48c..a743bdd 100644 --- a/shuffle.html +++ b/shuffle.html @@ -392,7 +392,7 @@

-

shuffle source npm

+

shuffle source npm

_.shuffle(collection)

Creates an array of shuffled values, using a version of the diff --git a/size.html b/size.html index 843b5b7..ab23f43 100644 --- a/size.html +++ b/size.html @@ -392,7 +392,7 @@

-

size source npm

+

size source npm

_.size(collection)

Gets the size of collection by returning its length for array-like diff --git a/slice.html b/slice.html index 9e41a7e..4b48c58 100644 --- a/slice.html +++ b/slice.html @@ -392,7 +392,7 @@

-

slice source npm

+

slice source npm

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

Creates a slice of array from start up to, but not including, end. diff --git a/snakeCase.html b/snakeCase.html index 6ed414d..0d4d052 100644 --- a/snakeCase.html +++ b/snakeCase.html @@ -392,7 +392,7 @@

-

snakeCase source npm

+

snakeCase source npm

_.snakeCase([string=''])

Converts string to snake case.

diff --git a/some.html b/some.html index f9aad72..d41660f 100644 --- a/some.html +++ b/some.html @@ -392,7 +392,7 @@
-

some source npm

+

some source npm

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

Checks if predicate returns truthy for any element of collection. diff --git a/sortBy.html b/sortBy.html index 70e8a0f..6308637 100644 --- a/sortBy.html +++ b/sortBy.html @@ -392,7 +392,7 @@

-

sortBy source npm

+

sortBy source npm

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

Creates an array of elements, sorted in ascending order by the results of diff --git a/sortedIndex.html b/sortedIndex.html index d17975d..ffb3547 100644 --- a/sortedIndex.html +++ b/sortedIndex.html @@ -392,7 +392,7 @@

-

sortedIndex source npm

+

sortedIndex source npm

_.sortedIndex(array, value)

Uses a binary search to determine the lowest index at which value should diff --git a/sortedIndexBy.html b/sortedIndexBy.html index 9c558f2..41e11a1 100644 --- a/sortedIndexBy.html +++ b/sortedIndexBy.html @@ -392,7 +392,7 @@

-

sortedIndexBy source npm

+

sortedIndexBy source npm

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

This method is like _.sortedIndex except that it accepts iteratee diff --git a/sortedIndexOf.html b/sortedIndexOf.html index 7077e72..ac153a0 100644 --- a/sortedIndexOf.html +++ b/sortedIndexOf.html @@ -392,7 +392,7 @@

-

sortedIndexOf source npm

+

sortedIndexOf source npm

_.sortedIndexOf(array, value)

This method is like _.indexOf except that it performs a binary diff --git a/sortedLastIndex.html b/sortedLastIndex.html index 38daba2..ebef09b 100644 --- a/sortedLastIndex.html +++ b/sortedLastIndex.html @@ -392,7 +392,7 @@

-

sortedLastIndex source npm

+

sortedLastIndex source npm

_.sortedLastIndex(array, value)

This method is like _.sortedIndex except that it returns the highest diff --git a/sortedLastIndexBy.html b/sortedLastIndexBy.html index 21f41bf..089b3f1 100644 --- a/sortedLastIndexBy.html +++ b/sortedLastIndexBy.html @@ -392,7 +392,7 @@

-

sortedLastIndexBy source npm

+

sortedLastIndexBy source npm

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

This method is like _.sortedLastIndex except that it accepts iteratee diff --git a/sortedLastIndexOf.html b/sortedLastIndexOf.html index 9b1c49c..4a59424 100644 --- a/sortedLastIndexOf.html +++ b/sortedLastIndexOf.html @@ -392,7 +392,7 @@

-

sortedLastIndexOf source npm

+

sortedLastIndexOf source npm

_.sortedLastIndexOf(array, value)

This method is like _.lastIndexOf except that it performs a binary diff --git a/sortedUniq.html b/sortedUniq.html index ac4d795..e2c3eff 100644 --- a/sortedUniq.html +++ b/sortedUniq.html @@ -392,7 +392,7 @@

-

sortedUniq source npm

+

sortedUniq source npm

_.sortedUniq(array)

This method is like _.uniq except that it's designed and optimized diff --git a/sortedUniqBy.html b/sortedUniqBy.html index 64c1cca..fe0596c 100644 --- a/sortedUniqBy.html +++ b/sortedUniqBy.html @@ -392,7 +392,7 @@

-

sortedUniqBy source npm

+

sortedUniqBy source npm

_.sortedUniqBy(array, [iteratee])

This method is like _.uniqBy except that it's designed and optimized diff --git a/split.html b/split.html index a171bcb..047177c 100644 --- a/split.html +++ b/split.html @@ -392,7 +392,7 @@

-

split source npm

+

split source npm

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

Splits string by separator. diff --git a/spread.html b/spread.html index a98e2a3..0e2254c 100644 --- a/spread.html +++ b/spread.html @@ -392,7 +392,7 @@

-

spread source npm

+

spread source npm

_.spread(func)

Creates a function that invokes func with the this binding of the created diff --git a/startCase.html b/startCase.html index f710f6a..06841b9 100644 --- a/startCase.html +++ b/startCase.html @@ -392,7 +392,7 @@

-

startCase source npm

+

startCase source npm

_.startCase([string=''])

Converts string to start case.

diff --git a/startsWith.html b/startsWith.html index ddc619f..e4b07c3 100644 --- a/startsWith.html +++ b/startsWith.html @@ -392,7 +392,7 @@
-

startsWith source npm

+

startsWith source npm

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

Checks if string starts with the given target string.

diff --git a/stringSize.html b/stringSize.html index c56781a..53165b2 100644 --- a/stringSize.html +++ b/stringSize.html @@ -392,7 +392,7 @@
-

stringSize source

+

stringSize source

stringSize(string)

Gets the number of symbols in string.

diff --git a/subtract.html b/subtract.html index 0bc2cee..3133b49 100644 --- a/subtract.html +++ b/subtract.html @@ -392,7 +392,7 @@
-

subtract source npm

+

subtract source npm

_.subtract(minuend, subtrahend)

Subtract two numbers.

diff --git a/sum.html b/sum.html index cb6e54b..7ec7d50 100644 --- a/sum.html +++ b/sum.html @@ -392,7 +392,7 @@
-

sum source npm

+

sum source npm

_.sum(array)

Computes the sum of the values in array.

diff --git a/sumBy.html b/sumBy.html index 060fa4e..9f1e77e 100644 --- a/sumBy.html +++ b/sumBy.html @@ -392,7 +392,7 @@
-

sumBy source npm

+

sumBy source npm

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

This method is like _.sum except that it accepts iteratee which is diff --git a/tail.html b/tail.html index cbd29a9..ffbad0c 100644 --- a/tail.html +++ b/tail.html @@ -392,7 +392,7 @@

-

tail source npm

+

tail source npm

_.tail(array)

Gets all but the first element of array.

diff --git a/take.html b/take.html index bc43094..9e3bced 100644 --- a/take.html +++ b/take.html @@ -392,7 +392,7 @@
-

take source npm

+

take source npm

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

Creates a slice of array with n elements taken from the beginning.

diff --git a/takeRight.html b/takeRight.html index 9876ddf..e9477b6 100644 --- a/takeRight.html +++ b/takeRight.html @@ -392,7 +392,7 @@
-

takeRight source npm

+

takeRight source npm

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

Creates a slice of array with n elements taken from the end.

diff --git a/takeRightWhile.html b/takeRightWhile.html index 761fc92..d2d20e8 100644 --- a/takeRightWhile.html +++ b/takeRightWhile.html @@ -392,7 +392,7 @@
-

takeRightWhile source npm

+

takeRightWhile source npm

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

Creates a slice of array with elements taken from the end. Elements are diff --git a/takeWhile.html b/takeWhile.html index 31a4e35..d045422 100644 --- a/takeWhile.html +++ b/takeWhile.html @@ -392,7 +392,7 @@

-

takeWhile source npm

+

takeWhile source npm

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

Creates a slice of array with elements taken from the beginning. Elements diff --git a/tap.html b/tap.html index 505ee79..cdc4c2c 100644 --- a/tap.html +++ b/tap.html @@ -392,7 +392,7 @@

-

tap source

+

tap source

_.tap(value, interceptor)

This method invokes interceptor and returns value. The interceptor is diff --git a/template.html b/template.html index f26bfbb..5a46081 100644 --- a/template.html +++ b/template.html @@ -392,7 +392,7 @@

-

template source npm

+

template source npm

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

Creates a compiled template function that can interpolate data properties diff --git a/templateSettings-escape.html b/templateSettings-escape.html index 2b57d4c..ca81dae 100644 --- a/templateSettings-escape.html +++ b/templateSettings-escape.html @@ -392,7 +392,7 @@

-

templateSettings.escape source

+

templateSettings.escape source

_.templateSettings.escape

(RegExp): Used to detect data property values to be HTML-escaped.

diff --git a/templateSettings-evaluate.html b/templateSettings-evaluate.html index 61d8de0..8da0108 100644 --- a/templateSettings-evaluate.html +++ b/templateSettings-evaluate.html @@ -392,7 +392,7 @@
-

templateSettings.evaluate source

+

templateSettings.evaluate source

_.templateSettings.evaluate

(RegExp): Used to detect code to be evaluated.

diff --git a/templateSettings-imports-_.html b/templateSettings-imports-_.html index dc9fca8..19998bc 100644 --- a/templateSettings-imports-_.html +++ b/templateSettings-imports-_.html @@ -392,7 +392,7 @@
-

templateSettings.imports._ source

+

templateSettings.imports._ source

_.templateSettings.imports._

A reference to the lodash function.

diff --git a/templateSettings-imports.html b/templateSettings-imports.html index 22fc829..e7ee2a2 100644 --- a/templateSettings-imports.html +++ b/templateSettings-imports.html @@ -392,7 +392,7 @@
-

templateSettings.imports source

+

templateSettings.imports source

_.templateSettings.imports

(Object): Used to import variables into the compiled template.

diff --git a/templateSettings-interpolate.html b/templateSettings-interpolate.html index 34c0853..7af8a4c 100644 --- a/templateSettings-interpolate.html +++ b/templateSettings-interpolate.html @@ -392,7 +392,7 @@
-

templateSettings.interpolate source

+

templateSettings.interpolate source

_.templateSettings.interpolate

(RegExp): Used to detect data property values to inject.

diff --git a/templateSettings-variable.html b/templateSettings-variable.html index bee691d..7ccd95b 100644 --- a/templateSettings-variable.html +++ b/templateSettings-variable.html @@ -392,7 +392,7 @@
-

templateSettings.variable source

+

templateSettings.variable source

_.templateSettings.variable

(string): Used to reference the data object in the template text.

diff --git a/templateSettings.html b/templateSettings.html index 2734b9e..99af6f1 100644 --- a/templateSettings.html +++ b/templateSettings.html @@ -392,7 +392,7 @@
-

templateSettings source npm

+

templateSettings source npm

_.templateSettings

(Object): By default, the template delimiters used by lodash are like those in diff --git a/throttle.html b/throttle.html index 11055a1..551d58f 100644 --- a/throttle.html +++ b/throttle.html @@ -392,7 +392,7 @@

-

throttle source npm

+

throttle source npm

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

Creates a throttled function that only invokes func at most once per diff --git a/thru.html b/thru.html index 5fae8da..3d67412 100644 --- a/thru.html +++ b/thru.html @@ -392,7 +392,7 @@

-

thru source

+

thru source

_.thru(value, interceptor)

This method is like _.tap except that it returns the result of interceptor.

diff --git a/times.html b/times.html index 142e2cb..6b52b4b 100644 --- a/times.html +++ b/times.html @@ -392,7 +392,7 @@
-

times source npm

+

times source npm

_.times(n, [iteratee=_.identity])

Invokes the iteratee function n times, returning an array of the results diff --git a/toArray.html b/toArray.html index eba0fee..6e1c052 100644 --- a/toArray.html +++ b/toArray.html @@ -392,7 +392,7 @@

-

toArray source npm

+

toArray source npm

_.toArray(value)

Converts value to an array.

diff --git a/toInteger.html b/toInteger.html index ddc5316..717c6e3 100644 --- a/toInteger.html +++ b/toInteger.html @@ -392,7 +392,7 @@
-

toInteger source npm

+

toInteger source npm

_.toInteger(value)

Converts value to an integer. diff --git a/toLength.html b/toLength.html index 0078d73..c554105 100644 --- a/toLength.html +++ b/toLength.html @@ -392,7 +392,7 @@

-

toLength source npm

+

toLength source npm

_.toLength(value)

Converts value to an integer suitable for use as the length of an diff --git a/toLower.html b/toLower.html index 22a4279..abe25f4 100644 --- a/toLower.html +++ b/toLower.html @@ -392,7 +392,7 @@

-

toLower source npm

+

toLower source npm

_.toLower([string=''])

Converts string, as a whole, to lower case.

diff --git a/toNumber.html b/toNumber.html index 0f97f82..3272c67 100644 --- a/toNumber.html +++ b/toNumber.html @@ -392,7 +392,7 @@
-

toNumber source npm

+

toNumber source npm

_.toNumber(value)

Converts value to a number.

diff --git a/toPairs.html b/toPairs.html index 6fcb670..11d5e38 100644 --- a/toPairs.html +++ b/toPairs.html @@ -392,7 +392,7 @@
-

toPairs source npm

+

toPairs source npm

_.toPairs(object)

Creates an array of own enumerable key-value pairs for object.

diff --git a/toPairsIn.html b/toPairsIn.html index 6df6d57..958317c 100644 --- a/toPairsIn.html +++ b/toPairsIn.html @@ -392,7 +392,7 @@
-

toPairsIn source npm

+

toPairsIn source npm

_.toPairsIn(object)

Creates an array of own and inherited enumerable key-value pairs for object.

diff --git a/toPath.html b/toPath.html index 36f76a1..1e16aa5 100644 --- a/toPath.html +++ b/toPath.html @@ -392,7 +392,7 @@
-

toPath source npm

+

toPath source npm

_.toPath(value)

Converts value to a property path array.

diff --git a/toPlainObject.html b/toPlainObject.html index fae0cd6..3802c3f 100644 --- a/toPlainObject.html +++ b/toPlainObject.html @@ -392,7 +392,7 @@
-

toPlainObject source npm

+

toPlainObject source npm

_.toPlainObject(value)

Converts value to a plain object flattening inherited enumerable diff --git a/toSafeInteger.html b/toSafeInteger.html index abfc16a..5a60439 100644 --- a/toSafeInteger.html +++ b/toSafeInteger.html @@ -392,7 +392,7 @@

-

toSafeInteger source npm

+

toSafeInteger source npm

_.toSafeInteger(value)

Converts value to a safe integer. A safe integer can be compared and diff --git a/toString.html b/toString.html index 45ebc06..a0bb7b3 100644 --- a/toString.html +++ b/toString.html @@ -392,7 +392,7 @@

-

toString source npm

+

toString source npm

_.toString(value)

Converts value to a string if it's not one. An empty string is returned diff --git a/toUpper.html b/toUpper.html index a05461a..5503f0c 100644 --- a/toUpper.html +++ b/toUpper.html @@ -392,7 +392,7 @@

-

toUpper source npm

+

toUpper source npm

_.toUpper([string=''])

Converts string, as a whole, to upper case.

diff --git a/transform.html b/transform.html index 7ce27e1..d784e74 100644 --- a/transform.html +++ b/transform.html @@ -392,7 +392,7 @@
-

transform source npm

+

transform source npm

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

An alternative to _.reduce; this method transforms object to a new diff --git a/trim.html b/trim.html index 0589d83..2641f55 100644 --- a/trim.html +++ b/trim.html @@ -392,7 +392,7 @@

-

trim source npm

+

trim source npm

_.trim([string=''], [chars=whitespace])

Removes leading and trailing whitespace or specified characters from string.

diff --git a/trimEnd.html b/trimEnd.html index 8cc927e..73359af 100644 --- a/trimEnd.html +++ b/trimEnd.html @@ -392,7 +392,7 @@
-

trimEnd source npm

+

trimEnd source npm

_.trimEnd([string=''], [chars=whitespace])

Removes trailing whitespace or specified characters from string.

diff --git a/trimStart.html b/trimStart.html index fe64817..8560c72 100644 --- a/trimStart.html +++ b/trimStart.html @@ -392,7 +392,7 @@
-

trimStart source npm

+

trimStart source npm

_.trimStart([string=''], [chars=whitespace])

Removes leading whitespace or specified characters from string.

diff --git a/truncate.html b/truncate.html index 335a691..130570b 100644 --- a/truncate.html +++ b/truncate.html @@ -392,7 +392,7 @@
-

truncate source npm

+

truncate source npm

_.truncate([string=''], [options])

Truncates string if it's longer than the given maximum string length. diff --git a/unary.html b/unary.html index 7d47a76..b80d651 100644 --- a/unary.html +++ b/unary.html @@ -392,7 +392,7 @@

-

unary source npm

+

unary source npm

_.unary(func)

Creates a function that accepts up to one argument, ignoring any diff --git a/unescape.html b/unescape.html index 2888d9c..92474d0 100644 --- a/unescape.html +++ b/unescape.html @@ -392,7 +392,7 @@

-

unescape source npm

+

unescape source npm

_.unescape([string=''])

The inverse of _.escape; this method converts the HTML entities diff --git a/union.html b/union.html index d923e1b..10a2175 100644 --- a/union.html +++ b/union.html @@ -392,7 +392,7 @@

-

union source npm

+

union source npm

_.union([arrays])

Creates an array of unique values, in order, from all of the provided arrays diff --git a/unionBy.html b/unionBy.html index da9fc5f..28a78be 100644 --- a/unionBy.html +++ b/unionBy.html @@ -392,7 +392,7 @@

-

unionBy source npm

+

unionBy source npm

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

This method is like _.union except that it accepts iteratee which is diff --git a/unionWith.html b/unionWith.html index 1193f72..5a7c2d0 100644 --- a/unionWith.html +++ b/unionWith.html @@ -392,7 +392,7 @@

-

unionWith source npm

+

unionWith source npm

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

This method is like _.union except that it accepts comparator which diff --git a/uniq.html b/uniq.html index 57ff3c8..9a697e4 100644 --- a/uniq.html +++ b/uniq.html @@ -392,7 +392,7 @@

-

uniq source npm

+

uniq source npm

_.uniq(array)

Creates a duplicate-free version of an array, using diff --git a/uniqBy.html b/uniqBy.html index 71d616a..27b5a64 100644 --- a/uniqBy.html +++ b/uniqBy.html @@ -392,7 +392,7 @@

-

uniqBy source npm

+

uniqBy source npm

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

This method is like _.uniq except that it accepts iteratee which is diff --git a/uniqWith.html b/uniqWith.html index c8862b1..9e5d9fa 100644 --- a/uniqWith.html +++ b/uniqWith.html @@ -392,7 +392,7 @@

-

uniqWith source npm

+

uniqWith source npm

_.uniqWith(array, [comparator])

This method is like _.uniq except that it accepts comparator which diff --git a/uniqueId.html b/uniqueId.html index 7733c9f..a67173c 100644 --- a/uniqueId.html +++ b/uniqueId.html @@ -392,7 +392,7 @@

-

uniqueId source npm

+

uniqueId source npm

_.uniqueId([prefix])

Generates a unique ID. If prefix is provided the ID is appended to it.

diff --git a/unset.html b/unset.html index ac09bdc..1421245 100644 --- a/unset.html +++ b/unset.html @@ -392,7 +392,7 @@
-

unset source npm

+

unset source npm

_.unset(object, path)

Removes the property at path of object.

diff --git a/unzip.html b/unzip.html index ca409c5..ad44c95 100644 --- a/unzip.html +++ b/unzip.html @@ -392,7 +392,7 @@
-

unzip source npm

+

unzip source npm

_.unzip(array)

This method is like _.zip except that it accepts an array of grouped diff --git a/unzipWith.html b/unzipWith.html index 6395c03..b062e5d 100644 --- a/unzipWith.html +++ b/unzipWith.html @@ -392,7 +392,7 @@

-

unzipWith source npm

+

unzipWith source npm

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

This method is like _.unzip except that it accepts iteratee to specify diff --git a/upperCase.html b/upperCase.html index 5db472d..ae56d75 100644 --- a/upperCase.html +++ b/upperCase.html @@ -392,7 +392,7 @@

-

upperCase source npm

+

upperCase source npm

_.upperCase([string=''])

Converts string, as space separated words, to upper case.

diff --git a/upperFirst.html b/upperFirst.html index 9bf5bc0..30d9572 100644 --- a/upperFirst.html +++ b/upperFirst.html @@ -392,7 +392,7 @@
-

upperFirst source npm

+

upperFirst source npm

_.upperFirst([string=''])

Converts the first character of string to upper case.

diff --git a/values.html b/values.html index 0d8d485..01f82fc 100644 --- a/values.html +++ b/values.html @@ -392,7 +392,7 @@
-

values source npm

+

values source npm

_.values(object)

Creates an array of the own enumerable property values of object. diff --git a/valuesIn.html b/valuesIn.html index b60dcf3..cc59062 100644 --- a/valuesIn.html +++ b/valuesIn.html @@ -392,7 +392,7 @@

-

valuesIn source npm

+

valuesIn source npm

_.valuesIn(object)

Creates an array of the own and inherited enumerable property values of object. diff --git a/without.html b/without.html index f198c63..921dcd8 100644 --- a/without.html +++ b/without.html @@ -392,7 +392,7 @@

-

without source npm

+

without source npm

_.without(array, [values])

Creates an array excluding all provided values using diff --git a/words.html b/words.html index 643ab56..a567149 100644 --- a/words.html +++ b/words.html @@ -392,7 +392,7 @@

-

words source npm

+

words source npm

_.words([string=''], [pattern])

Splits string into an array of its words.

diff --git a/wrap.html b/wrap.html index c626361..3a1e083 100644 --- a/wrap.html +++ b/wrap.html @@ -392,7 +392,7 @@
-

wrap source npm

+

wrap source npm

_.wrap(value, wrapper)

Creates a function that provides value to the wrapper function as its diff --git a/wrapperFlatMap.html b/wrapperFlatMap.html index a2bbdac..c1dc2f6 100644 --- a/wrapperFlatMap.html +++ b/wrapperFlatMap.html @@ -392,7 +392,7 @@

-

wrapperFlatMap source

+

wrapperFlatMap source

_.wrapperFlatMap([iteratee=_.identity])

This method is the wrapper version of _.flatMap.

diff --git a/xor.html b/xor.html index 435ef8f..7b8cb1c 100644 --- a/xor.html +++ b/xor.html @@ -392,7 +392,7 @@
-

xor source npm

+

xor source npm

_.xor([arrays])

Creates an array of unique values that is the symmetric difference diff --git a/xorBy.html b/xorBy.html index 0a5b3cc..e7cd908 100644 --- a/xorBy.html +++ b/xorBy.html @@ -392,7 +392,7 @@

-

xorBy source npm

+

xorBy source npm

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

This method is like _.xor except that it accepts iteratee which is diff --git a/xorWith.html b/xorWith.html index 3b86884..5a67b1c 100644 --- a/xorWith.html +++ b/xorWith.html @@ -392,7 +392,7 @@

-

xorWith source npm

+

xorWith source npm

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

This method is like _.xor except that it accepts comparator which is diff --git a/zip.html b/zip.html index b75694a..b7aad19 100644 --- a/zip.html +++ b/zip.html @@ -392,7 +392,7 @@

-

zip source npm

+

zip source npm

_.zip([arrays])

Creates an array of grouped elements, the first of which contains the first diff --git a/zipObject.html b/zipObject.html index eb33c82..f70a669 100644 --- a/zipObject.html +++ b/zipObject.html @@ -392,7 +392,7 @@

-

zipObject source npm

+

zipObject source npm

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

This method is like _.fromPairs except that it accepts two arrays, diff --git a/zipWith.html b/zipWith.html index 66ffe59..cc2c274 100644 --- a/zipWith.html +++ b/zipWith.html @@ -392,7 +392,7 @@

-

zipWith source npm

+

zipWith source npm

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

This method is like _.zip except that it accepts iteratee to specify