From cce1ebb08d7cc2bb2f97b7ebfc9b99dc740ff38a Mon Sep 17 00:00:00 2001 From: think2011 <452125301@qq.com> Date: Wed, 13 Jan 2016 23:04:42 +0800 Subject: [PATCH] publish --- VERSION.html | 2 +- add.html | 2 +- all.html | 666 ++++++++++++++++++++--------------------- assign.html | 2 +- assignIn.html | 2 +- assignInWith.html | 2 +- assignWith.html | 2 +- at.html | 2 +- attempt.html | 2 +- bindAll.html | 2 +- camelCase.html | 2 +- capitalize.html | 2 +- ceil.html | 2 +- clamp.html | 2 +- clone.html | 18 +- cloneDeep.html | 8 +- cloneDeepWith.html | 10 +- cloneWith.html | 15 +- cond.html | 2 +- conforms.html | 4 +- constant.html | 2 +- create.html | 2 +- deburr.html | 2 +- defaults.html | 2 +- defaultsDeep.html | 2 +- endsWith.html | 4 +- eq.html | 11 +- escape.html | 2 +- escapeRegExp.html | 2 +- findKey.html | 2 +- findLastKey.html | 2 +- floor.html | 2 +- flow.html | 2 +- flowRight.html | 2 +- forIn.html | 2 +- forInRight.html | 2 +- forOwn.html | 2 +- forOwnRight.html | 2 +- functions.html | 2 +- functionsIn.html | 2 +- get.html | 2 +- gt.html | 10 +- gte.html | 10 +- has.html | 4 +- hasIn.html | 4 +- identity.html | 2 +- inRange.html | 4 +- index.html | 2 +- invert.html | 2 +- invoke.html | 2 +- isArguments.html | 8 +- isArray.html | 8 +- isArrayLike.html | 11 +- isArrayLikeObject.html | 9 +- isBoolean.html | 8 +- isDate.html | 8 +- isElement.html | 8 +- isEmpty.html | 11 +- isEqual.html | 18 +- isEqualWith.html | 17 +- isError.html | 10 +- isFinite.html | 10 +- isFunction.html | 8 +- isInteger.html | 10 +- isLength.html | 10 +- isMatch.html | 13 +- isMatchWith.html | 17 +- isNaN.html | 12 +- isNative.html | 8 +- isNil.html | 8 +- isNull.html | 8 +- isNumber.html | 8 +- isObject.html | 10 +- isObjectLike.html | 10 +- isPlainObject.html | 8 +- isRegExp.html | 8 +- isSafeInteger.html | 8 +- isString.html | 8 +- isSymbol.html | 8 +- isTypedArray.html | 8 +- isUndefined.html | 8 +- iteratee.html | 2 +- js/lodash-zh.js | 450 ++++++++++++++-------------- kebabCase.html | 2 +- keys.html | 2 +- keysIn.html | 2 +- lowerCase.html | 2 +- lowerFirst.html | 2 +- lt.html | 10 +- lte.html | 10 +- mapKeys.html | 2 +- mapValues.html | 2 +- matches.html | 4 +- matchesProperty.html | 4 +- max.html | 2 +- maxBy.html | 2 +- mean.html | 2 +- merge.html | 2 +- mergeWith.html | 2 +- method.html | 2 +- methodOf.html | 2 +- min.html | 2 +- minBy.html | 2 +- mixin.html | 2 +- noConflict.html | 2 +- noop.html | 2 +- nthArg.html | 2 +- omit.html | 2 +- omitBy.html | 2 +- over.html | 2 +- overEvery.html | 2 +- overSome.html | 2 +- pad.html | 2 +- padEnd.html | 2 +- padStart.html | 2 +- pages.json | 322 ++++++++++---------- parseInt.html | 2 +- pick.html | 2 +- pickBy.html | 2 +- property.html | 2 +- propertyOf.html | 2 +- random.html | 2 +- range.html | 2 +- rangeRight.html | 2 +- repeat.html | 2 +- replace.html | 2 +- result.html | 2 +- round.html | 2 +- set.html | 2 +- setWith.html | 2 +- snakeCase.html | 2 +- split.html | 2 +- startCase.html | 2 +- startsWith.html | 4 +- subtract.html | 2 +- sum.html | 2 +- sumBy.html | 2 +- template.html | 2 +- times.html | 2 +- toArray.html | 2 +- toInteger.html | 2 +- toLength.html | 2 +- toLower.html | 2 +- toNumber.html | 2 +- toPairs.html | 2 +- toPairsIn.html | 2 +- toPath.html | 2 +- toPlainObject.html | 2 +- toSafeInteger.html | 2 +- toString.html | 2 +- toUpper.html | 2 +- transform.html | 2 +- trim.html | 2 +- trimEnd.html | 2 +- trimStart.html | 2 +- truncate.html | 2 +- unescape.html | 2 +- uniqueId.html | 2 +- unset.html | 4 +- upperCase.html | 2 +- upperFirst.html | 2 +- values.html | 2 +- valuesIn.html | 2 +- words.html | 2 +- 164 files changed, 1037 insertions(+), 1067 deletions(-) diff --git a/VERSION.html b/VERSION.html index e4dcb1e..a6b924f 100644 --- a/VERSION.html +++ b/VERSION.html @@ -392,7 +392,7 @@
-

VERSION source

+

VERSION source

_.VERSION

(string): The semantic version number.

diff --git a/add.html b/add.html index 5d75d10..37d5fb3 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/all.html b/all.html index 313013c..d432df6 100644 --- a/all.html +++ b/all.html @@ -464,7 +464,7 @@

特点

关于翻译

    -
  • 该文档由 think2011 翻译,遵循 MIT协议, 保持与官方同步,翻译质量可能没法特别好,但会保证尽可能反复细心。
  • +
  • 该文档由 think2011 翻译,遵循 MIT协议, 定时保持与官方同步,翻译质量可能没法特别好,但会保证尽可能反复细心。
  • 如果您有任何建议,或者意见,欢迎在此讨论,及时更正 ;-)
@@ -7305,25 +7305,25 @@

示例

clone source npm

_.clone(value)
-

Creates a shallow clone of value. +

创建一个 value 的浅拷贝。

-注意: 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 are cloned -as plain objects. An empty object is returned for uncloneable values such -as error objects, functions, DOM nodes, and WeakMaps.

+以及支持 arrays、array buffers、 booleans、 date objects、maps、 +numbers, Object objects, regexes, sets, strings, symbols, 以及 typed +arrays。 +参数对象的可枚举属性会拷贝为普通对象。 +一些不可拷贝的对象,例如error objects、functions, DOM nodes, 以及 WeakMaps 会返回空对象。

参数

    -
  1. value (*)

    The value to clone.

    +
  2. value (*)

    要拷贝的值

返回值 (*)

-

Returns the cloned value.

+

返回拷贝后的值

示例

var users = [
@@ -7363,19 +7363,19 @@ 

示例

})();
-

cloneDeep source npm

+

cloneDeep source npm

_.cloneDeep(value)
-

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

+

这个方法类似 _.clone,除了它会递归拷贝 value

参数

    -
  1. value (*)

    The value to recursively clone.

    +
  2. value (*)

    要深拷贝的值

返回值 (*)

-

Returns the deep cloned value.

+

返回拷贝后的值

示例

var users = [
@@ -7415,21 +7415,21 @@ 

示例

})();
-

cloneDeepWith source npm

+

cloneDeepWith source npm

_.cloneDeepWith(value, [customizer])
-

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

+

这个方法类似 _.cloneWith,除了它会递归拷贝 value

参数

    -
  1. value (*)

    The value to recursively clone.

    +
  2. value (*)

    要深拷贝的值

  3. -
  4. [customizer] (Function)

    The function to customize cloning.

    +
  5. [customizer] (Function)

    这个函数定制返回的拷贝值

返回值 (*)

-

Returns the deep cloned value.

+

返回拷贝后的值

示例

function customizer(value) {
@@ -7475,24 +7475,23 @@ 

示例

})();
-

cloneWith source npm

+

cloneWith source npm

_.cloneWith(value, [customizer])
-

This method is like _.clone except that it accepts customizer which -is invoked to produce the cloned value. If customizer returns undefined -cloning is handled by the method instead. The customizer is invoked with -up to five arguments; (value [, index|key, object, stack]).

+

这个方法类似 _.clone,除了它接受一个 customizer 定制返回的拷贝值。 +如果 customizer 返回 undefined 将会拷贝处理方法代替。 +customizer 会传入5个参数:(value [, index|key, object, stack])

参数

    -
  1. value (*)

    The value to clone.

    +
  2. value (*)

    要拷贝的值

  3. -
  4. [customizer] (Function)

    The function to customize cloning.

    +
  5. [customizer] (Function)

    这个函数定制返回的拷贝值

返回值 (*)

-

Returns the cloned value.

+

返回拷贝后的值

示例

function customizer(value) {
@@ -7538,22 +7537,21 @@ 

示例

})();
-

eq source npm

+

eq source npm

_.eq(value, other)
-

Performs a SameValueZero -comparison between two values to determine if they are equivalent.

+

执行 SameValueZero 比较两者的值确定它们是否相等。

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if the values are equivalent, else false.

+

相等返回 true,否则返回 false

示例

var object = { 'user': 'fred' };
@@ -7602,21 +7600,21 @@ 

示例

})();
-

gt source npm

+

gt source npm

_.gt(value, other)
-

Checks if value is greater than other.

+

检查 value 是否大于 other

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is greater than other, else false.

+

如果 value 大于 other,返回 true,否则返回 false

示例

_.gt(3, 1);
@@ -7656,21 +7654,21 @@ 

示例

})();
-

gte source npm

+

gte source npm

_.gte(value, other)
-

Checks if value is greater than or equal to other.

+

检查 value 是否大于等于 other

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is greater than or equal to other, else false.

+

如果 value 大于等于 other,返回 true,否则返回 false

示例

_.gte(3, 1);
@@ -7710,19 +7708,19 @@ 

示例

})();
-

isArguments source npm

+

isArguments source npm

_.isArguments(value)
-

Checks if value is likely an arguments object.

+

检查 value 是否是 类 arguments 对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isArguments(function() { return arguments; }());
@@ -7759,19 +7757,19 @@ 

示例

})();
-

isArray source npm

+

isArray source npm

_.isArray(value)
-

Checks if value is classified as an Array object.

+

检查 value 是否是 Array 类对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isArray([1, 2, 3]);
@@ -7814,21 +7812,20 @@ 

示例

})();
-

isArrayLike source npm

+

isArrayLike source npm

_.isArrayLike(value)
-

Checks if value is array-like. A value is considered array-like if it's -not a function and has a value.length that's an integer greater than or -equal to 0 and less than or equal to Number.MAX_SAFE_INTEGER.

+

检查 value 是否是类数组。 +如果是类数组的话,应该不是一个函数,而且 value.length 是个整数,大于等于 0,小于或等于 Number.MAX_SAFE_INTEGER

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is array-like, else false.

+

如果是类数组,返回 true,否则返回 false

示例

_.isArrayLike([1, 2, 3]);
@@ -7871,20 +7868,19 @@ 

示例

})();
-

isArrayLikeObject source npm

+

isArrayLikeObject source npm

_.isArrayLikeObject(value)
-

This method is like _.isArrayLike except that it also checks if value -is an object.

+

这个方法类似 _.isArrayLike,除了它还检查值是否是个对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an array-like object, else false.

+

如果是类数组对象,返回 true,否则返回 false

示例

_.isArrayLikeObject([1, 2, 3]);
@@ -7927,19 +7923,19 @@ 

示例

})();
-

isBoolean source npm

+

isBoolean source npm

_.isBoolean(value)
-

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

+

检查 value 是否是原始 boolean 类型或者对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isBoolean(false);
@@ -7976,19 +7972,19 @@ 

示例

})();
-

isDate source npm

+

isDate source npm

_.isDate(value)
-

Checks if value is classified as a Date object.

+

检查 value 是否是 Date 类型

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isDate(new Date);
@@ -8025,19 +8021,19 @@ 

示例

})();
-

isElement source npm

+

isElement source npm

_.isElement(value)
-

Checks if value is likely a DOM element.

+

检查 value 是否是可能是 DOM 元素

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a DOM element, else false.

+

如果是 DOM 元素返回 true,否则返回 false

示例

_.isElement(document.body);
@@ -8074,21 +8070,20 @@ 

示例

})();
-

isEmpty source npm

+

isEmpty source npm

_.isEmpty(value)
-

Checks if value is empty. A value is considered empty unless it's an -arguments object, array, string, or jQuery-like collection with a length -greater than 0 or an object with own enumerable properties.

+

检查 value 是否为空。 +判断的依据是除非是有枚举属性的对象,length 大于 0arguments object, array, string 或类jquery选择器。

参数

    -
  1. value (Array|Object|string)

    The value to inspect.

    +
  2. value (Array|Object|string)

    要检查的值

返回值 (boolean)

-

Returns true if value is empty, else false.

+

如果为空返回 true,否则返回 false

示例

_.isEmpty(null);
@@ -8134,29 +8129,27 @@ 

示例

})();
-

isEqual source npm

+

isEqual source npm

_.isEqual(value, other)
-

Performs a deep comparison between two values to determine if they are -equivalent. +

执行深比较来决定两者的值是否相等。

-注意: This method supports comparing arrays, array buffers, booleans, +注意: 这个方法支持比较 arrays, array buffers, booleans, date objects, error objects, maps, numbers, Object objects, regexes, -sets, strings, symbols, and typed arrays. Object objects are compared -by their own, not inherited, enumerable properties. Functions and DOM -nodes are not supported.

+sets, strings, symbols, 以及 typed arrays. Object 对象值比较自身的属性,不包括继承的和可枚举的属性。 +不支持函数和DOM节点。

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if the values are equivalent, else false.

+

如果相等返回 true,否则返回 false

示例

var object = { 'user': 'fred' };
@@ -8196,26 +8189,25 @@ 

示例

})();
-

isEqualWith source npm

+

isEqualWith source npm

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

This method is like _.isEqual except that it accepts customizer which is -invoked to compare values. If customizer returns undefined comparisons are -handled by the method instead. The customizer is invoked with up to seven arguments:
-(objValue, othValue [, index|key, object, other, stack]).

+

这个方法类似 _.isEqual。 +除了它接受一个 customizer 定制比较值。 如果 customizer 返回 undefined 将会比较处理方法代替。 +customizer 会传入7个参数:(objValue, othValue [, index|key, object, other, stack])

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

  6. -
  7. [customizer] (Function)

    The function to customize comparisons.

    +
  8. [customizer] (Function)

    这个函数定制比较值

返回值 (boolean)

-

Returns true if the values are equivalent, else false.

+

如果相等返回 true,否则返回 false

示例

function isGreeting(value) {
@@ -8262,20 +8254,20 @@ 

示例

})();
-

isError source npm

+

isError source npm

_.isError(value)
-

Checks if value is an Error, EvalError, RangeError, ReferenceError, -SyntaxError, TypeError, or URIError object.

+

检查 value 是否是 Error, EvalError, RangeError, ReferenceError, +SyntaxError, TypeError, 或 URIError object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an error object, else false.

+

如果是 error object 返回 true,否则返回 false

示例

_.isError(new Error);
@@ -8312,22 +8304,22 @@ 

示例

})();
-

isFinite source npm

+

isFinite source npm

_.isFinite(value)
-

Checks if value is a finite primitive number. +

检查 value 是否是原始 finite number。

-注意: This method is based on Number.isFinite.

+注意: 这个方法基于 Number.isFinite.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a finite number, else false.

+

如果是 finite number 返回 true,否则返回 false

示例

_.isFinite(3);
@@ -8370,19 +8362,19 @@ 

示例

})();
-

isFunction source npm

+

isFunction source npm

_.isFunction(value)
-

Checks if value is classified as a Function object.

+

检查 value 是否是 Function 对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isFunction(_);
@@ -8419,22 +8411,22 @@ 

示例

})();
-

isInteger source npm

+

isInteger source npm

_.isInteger(value)
-

Checks if value is an integer. +

检查 value 是否是整数。

-注意: This method is based on Number.isInteger.

+注意: 这个方法基于 Number.isInteger.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an integer, else false.

+

如果是整数返回 true,否则返回 false

示例

_.isInteger(3);
@@ -8477,22 +8469,22 @@ 

示例

})();
-

isLength source npm

+

isLength source npm

_.isLength(value)
-

Checks if value is a valid array-like length. +

检查 value 是否是有效长度

-注意: This function is loosely based on ToLength.

+注意: 这个方法参考自 ToLength.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a valid length, else false.

+

如果是有效长度返回 true,否则返回 false

示例

_.isLength(3);
@@ -8535,25 +8527,24 @@ 

示例

})();
-

isMatch source npm

+

isMatch source npm

_.isMatch(object, source)
-

Performs a deep comparison between object and source to determine if -object contains equivalent property values. +

执行一个深比较来确定object 是否包含有 source 的属性值。

-注意: This method supports comparing the same values as _.isEqual.

+注意: 这个方法支持比较相同的值和 _.isEqual 一样

参数

    -
  1. object (Object)

    The object to inspect.

    +
  2. object (Object)

    要检查的值

  3. -
  4. source (Object)

    The object of property values to match.

    +
  5. source (Object)

    匹配包含在 object 的对象

返回值 (boolean)

-

Returns true if object is a match, else false.

+

如果匹配返回 true,否则返回 false

示例

var object = { 'user': 'fred', 'age': 40 };
@@ -8592,26 +8583,25 @@ 

示例

})();
-

isMatchWith source npm

+

isMatchWith source npm

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

This method is like _.isMatch except that it accepts customizer which -is invoked to compare values. If customizer returns undefined comparisons -are handled by the method instead. The customizer is invoked with three -arguments: (objValue, srcValue, index|key, object, source).

+

这个方法类似 _.isMatch。 +除了它接受一个 customizer 定制比较的值。 +如果 customizer 返回 undefined 将会比较处理方法代替。 customizer 会传入5个参数:(objValue, srcValue, index|key, object, source)

参数

    -
  1. object (Object)

    The object to inspect.

    +
  2. object (Object)

    要检查的值

  3. -
  4. source (Object)

    The object of property values to match.

    +
  5. source (Object)

    匹配包含在 object 的对象

  6. -
  7. [customizer] (Function)

    The function to customize comparisons.

    +
  8. [customizer] (Function)

    这个函数定制比较值

返回值 (boolean)

-

Returns true if object is a match, else false.

+

如果匹配返回 true,否则返回 false

示例

function isGreeting(value) {
@@ -8658,23 +8648,23 @@ 

示例

})();
-

isNaN source npm

+

isNaN source npm

_.isNaN(value)
-

Checks if value is NaN. +

检查 value 是否是 NaN.

-注意: This method is not the same as isNaN -which returns true for undefined and other non-numeric values.

+注意: 这个方法不同于 isNaN +对 undefind 和 其他非数值返回 true.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is NaN, else false.

+

如果符合 NaN 返回 true,否则返回 false

示例

_.isNaN(NaN);
@@ -8717,19 +8707,19 @@ 

示例

})();
-

isNative source npm

+

isNative source npm

_.isNative(value)
-

Checks if value is a native function.

+

检查 value 是否是原生函数

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a native function, else false.

+

如果是原生函数返回 true,否则返回 false

示例

_.isNative(Array.prototype.push);
@@ -8766,19 +8756,19 @@ 

示例

})();
-

isNil source npm

+

isNil source npm

_.isNil(value)
-

Checks if value is null or undefined.

+

检查 value 是否是 null 或者 undefined

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is nullish, else false.

+

如果是 null 或者 undefined 返回 true,否则返回 false

示例

_.isNil(null);
@@ -8818,19 +8808,19 @@ 

示例

})();
-

isNull source npm

+

isNull source npm

_.isNull(value)
-

Checks if value is null.

+

检查 value 是否是 null.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is null, else false.

+

如果是 null 返回 true,否则返回 false

示例

_.isNull(null);
@@ -8867,10 +8857,10 @@ 

示例

})();
-

isNumber source npm

+

isNumber source npm

_.isNumber(value)
-

Checks if value is classified as a Number primitive or object. +

检查 value 是否是 as a Number primitive or object.

注意: To exclude Infinity, -Infinity, and NaN, which are classified @@ -8879,11 +8869,11 @@

示例

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isNumber(3);
@@ -8926,20 +8916,20 @@ 

示例

})();
-

isObject source npm

+

isObject source npm

_.isObject(value)
-

Checks if value is the language type of Object. -(e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))

+

检查 value 是否是 Objectlanguage type。 +(例如: arrays, functions, objects, regexes, new Number(0), 以及 new String(''))

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an object, else false.

+

如果是对象返回 true,否则返回 false

示例

_.isObject({});
@@ -8982,20 +8972,20 @@ 

示例

})();
-

isObjectLike source npm

+

isObjectLike source npm

_.isObjectLike(value)
-

Checks if value is object-like. A value is object-like if it's not null -and has a typeof result of "object".

+

检查 value 是否是 类对象。 +类对象应该不是 null 以及 typeof 的结果是 "object"。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is object-like, else false.

+

如果是类对象返回 true,否则返回 false

示例

_.isObjectLike({});
@@ -9038,20 +9028,20 @@ 

示例

})();
-

isPlainObject source npm

+

isPlainObject source npm

_.isPlainObject(value)
-

Checks if value is a plain object, that is, an object created by the +

检查 value 是否是 a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a plain object, else false.

+

Returns true if value is a plain object否则返回 false

示例

function Foo() {
@@ -9098,19 +9088,19 @@ 

示例

})();
-

isRegExp source npm

+

isRegExp source npm

_.isRegExp(value)
-

Checks if value is classified as a RegExp object.

+

检查 value 是否是 as a RegExp object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isRegExp(/abc/);
@@ -9147,10 +9137,10 @@ 

示例

})();
-

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 +

检查 value 是否是 a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer.

@@ -9159,11 +9149,11 @@

示例

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a safe integer, else false.

+

Returns true if value is a safe integer否则返回 false

示例

_.isSafeInteger(3);
@@ -9206,19 +9196,19 @@ 

示例

})();
-

isString source npm

+

isString source npm

_.isString(value)
-

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

+

检查 value 是否是 as a String primitive or object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isString('abc');
@@ -9255,19 +9245,19 @@ 

示例

})();
-

isSymbol source npm

+

isSymbol source npm

_.isSymbol(value)
-

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

+

检查 value 是否是 as a Symbol primitive or object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isSymbol(Symbol.iterator);
@@ -9304,19 +9294,19 @@ 

示例

})();
-

isTypedArray source npm

+

isTypedArray source npm

_.isTypedArray(value)
-

Checks if value is classified as a typed array.

+

检查 value 是否是 as a typed array.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isTypedArray(new Uint8Array);
@@ -9353,19 +9343,19 @@ 

示例

})();
-

isUndefined source npm

+

isUndefined source npm

_.isUndefined(value)
-

Checks if value is undefined.

+

检查 value 是否是 undefined.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is undefined, else false.

+

Returns true if value is undefined否则返回 false

示例

_.isUndefined(void 0);
@@ -9402,21 +9392,21 @@ 

示例

})();
-

lt source npm

+

lt source npm

_.lt(value, other)
-

Checks if value is less than other.

+

检查 value 是否是 less than other.

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is less than other, else false.

+

Returns true if value is less than other否则返回 false

示例

_.lt(1, 3);
@@ -9456,21 +9446,21 @@ 

示例

})();
-

lte source npm

+

lte source npm

_.lte(value, other)
-

Checks if value is less than or equal to other.

+

检查 value 是否是 less than or equal to other.

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is less than or equal to other, else false.

+

Returns true if value is less than or equal to other否则返回 false

示例

_.lte(1, 3);
@@ -9510,7 +9500,7 @@ 

示例

})();
-

toArray source npm

+

toArray source npm

_.toArray(value)

Converts value to an array.

@@ -9558,7 +9548,7 @@

示例

})();
-

toInteger source npm

+

toInteger source npm

_.toInteger(value)

Converts value to an integer. @@ -9616,7 +9606,7 @@

示例

})();
-

toLength source npm

+

toLength source npm

_.toLength(value)

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

示例

})();
-

toNumber source npm

+

toNumber source npm

_.toNumber(value)

Converts value to a number.

@@ -9727,7 +9717,7 @@

示例

})();
-

toPlainObject source npm

+

toPlainObject source npm

_.toPlainObject(value)

Converts value to a plain object flattening inherited enumerable @@ -9783,7 +9773,7 @@

示例

})();
-

toSafeInteger source npm

+

toSafeInteger source npm

_.toSafeInteger(value)

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

示例

})();
-

toString source npm

+

toString source npm

_.toString(value)

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

示例

})();
-

add source npm

+

add source npm

_.add(augend, addend)

Adds two numbers.

@@ -9940,7 +9930,7 @@

示例

})();
-

ceil source npm

+

ceil source npm

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

Computes number rounded up to precision.

@@ -9994,7 +9984,7 @@

示例

})();
-

floor source npm

+

floor source npm

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

Computes number rounded down to precision.

@@ -10048,7 +10038,7 @@

示例

})();
-

max source npm

+

max source npm

_.max(array)

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

示例

})();
-

maxBy source npm

+

maxBy source npm

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

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

示例

})();
-

mean source npm

+

mean source npm

_.mean(array)

Computes the mean of the values in array.

@@ -10203,7 +10193,7 @@

示例

})();
-

min source npm

+

min source npm

_.min(array)

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

示例

})();
-

minBy source npm

+

minBy source npm

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

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

示例

})();
-

round source npm

+

round source npm

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

Computes number rounded to precision.

@@ -10366,7 +10356,7 @@

示例

})();
-

subtract source npm

+

subtract source npm

_.subtract(minuend, subtrahend)

Subtract two numbers.

@@ -10414,7 +10404,7 @@

示例

})();
-

sum source npm

+

sum source npm

_.sum(array)

Computes the sum of the values in array.

@@ -10460,7 +10450,7 @@

示例

})();
-

sumBy source npm

+

sumBy source npm

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

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

返回值 (number)

})();
-

clamp source npm

+

clamp source npm

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

Returns a number whose value is limited to the given range specified @@ -10644,7 +10634,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 @@ -10663,7 +10653,7 @@

参数

返回值 (boolean)

-

Returns true if number is in the range, else false.

+

Returns true if number is in the range否则返回 false

示例

_.inRange(3, 2, 4);
@@ -10715,7 +10705,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 @@ -10781,7 +10771,7 @@

示例

})();
-

assign source npm

+

assign source npm

_.assign(object, [sources])

Assigns own enumerable properties of source objects to the destination @@ -10846,7 +10836,7 @@

示例

})();
-

assignIn extend source npm

+

assignIn extend source npm

_.assignIn(object, [sources])

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

示例

})();
-

assignInWith extendWith source npm

+

assignInWith extendWith source npm

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

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

示例

})();
-

assignWith source npm

+

assignWith source npm

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

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

示例

})();
-

at source npm

+

at source npm

_.at(object, [paths])

Creates an array of values corresponding to paths of object.

@@ -11086,7 +11076,7 @@

示例

})();
-

create source npm

+

create source npm

_.create(prototype, [properties])

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

示例

})();
-

defaults source npm

+

defaults source npm

_.defaults(object, [sources])

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

示例

})();
-

defaultsDeep source npm

+

defaultsDeep source npm

_.defaultsDeep(object, [sources])

This method is like _.defaults except that it recursively assigns @@ -11258,7 +11248,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 @@ -11325,7 +11315,7 @@

示例

})();
-

findLastKey source npm

+

findLastKey source npm

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

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

示例

})();
-

forIn source npm

+

forIn source npm

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

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

示例

})();
-

forInRight source npm

+

forInRight source npm

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

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

示例

})();
-

forOwn source npm

+

forOwn source npm

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

Iterates over own enumerable properties of an object invoking iteratee @@ -11570,7 +11560,7 @@

示例

})();
-

forOwnRight source npm

+

forOwnRight source npm

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

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

示例

})();
-

functions source npm

+

functions source npm

_.functions(object)

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

示例

})();
-

functionsIn source npm

+

functionsIn source npm

_.functionsIn(object)

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

示例

})();
-

get source npm

+

get source npm

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

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

示例

})();
-

has source npm

+

has source npm

_.has(object, path)

Checks if path is a direct property of object.

@@ -11809,7 +11799,7 @@

参数

返回值 (boolean)

-

Returns true if path exists, else false.

+

Returns true if path exists否则返回 false

示例

var object = { 'a': { 'b': { 'c': 3 } } };
@@ -11855,7 +11845,7 @@ 

示例

})();
-

hasIn source npm

+

hasIn source npm

_.hasIn(object, path)

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

@@ -11869,7 +11859,7 @@

参数

返回值 (boolean)

-

Returns true if path exists, else false.

+

Returns true if path exists否则返回 false

示例

var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
@@ -11914,7 +11904,7 @@ 

示例

})();
-

invert source npm

+

invert source npm

_.invert(object, [multiVal])

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

示例

})();
-

invoke source npm

+

invoke source npm

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

Invokes the method at path of object.

@@ -12022,7 +12012,7 @@

示例

})();
-

keys source npm

+

keys source npm

_.keys(object)

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

示例

})();
-

keysIn source npm

+

keysIn source npm

_.keysIn(object)

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

示例

})();
-

mapKeys source npm

+

mapKeys source npm

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

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

示例

})();
-

mapValues source npm

+

mapValues source npm

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

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

示例

})();
-

merge source npm

+

merge source npm

_.merge(object, [sources])

Recursively merges own and inherited enumerable properties of source @@ -12314,7 +12304,7 @@

示例

})();
-

mergeWith source npm

+

mergeWith source npm

_.mergeWith(object, sources, customizer)

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

示例

})();
-

omit source npm

+

omit source npm

_.omit(object, [props])

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

示例

})();
-

omitBy source npm

+

omitBy source npm

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

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

示例

})();
-

pick source npm

+

pick source npm

_.pick(object, [props])

Creates an object composed of the picked object properties.

@@ -12537,7 +12527,7 @@

示例

})();
-

pickBy source npm

+

pickBy source npm

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

Creates an object composed of the object properties predicate returns @@ -12588,7 +12578,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 @@ -12651,7 +12641,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 @@ -12711,7 +12701,7 @@

示例

})();
-

setWith source npm

+

setWith source npm

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

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

示例

})();
-

toPairs source npm

+

toPairs source npm

_.toPairs(object)

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

@@ -12819,7 +12809,7 @@

示例

})();
-

toPairsIn source npm

+

toPairsIn source npm

_.toPairsIn(object)

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

@@ -12872,7 +12862,7 @@

示例

})();
-

transform source npm

+

transform source npm

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

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

示例

})();
-

unset source npm

+

unset source npm

_.unset(object, path)

Removes the property at path of object.

@@ -12949,7 +12939,7 @@

参数

返回值 (boolean)

-

Returns true if the property is deleted, else false.

+

Returns true if the property is deleted否则返回 false

示例

var object = { 'a': [{ 'b': { 'c': 7 } }] };
@@ -12993,7 +12983,7 @@ 

示例

})();
-

values source npm

+

values source npm

_.values(object)

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

示例

})();
-

valuesIn source npm

+

valuesIn source npm

_.valuesIn(object)

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

示例

})();
-

VERSION source

+

VERSION source

_.VERSION

(string): The semantic version number.

@@ -13341,7 +13331,7 @@

示例

})();
-

camelCase source npm

+

camelCase source npm

_.camelCase([string=''])

Converts string to camel case.

@@ -13393,7 +13383,7 @@

示例

})();
-

capitalize source npm

+

capitalize source npm

_.capitalize([string=''])

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

示例

})();
-

deburr source npm

+

deburr source npm

_.deburr([string=''])

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

示例

})();
-

endsWith source npm

+

endsWith source npm

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

Checks if string ends with the given target string.

@@ -13503,7 +13493,7 @@

参数

返回值 (boolean)

-

Returns true if string ends with target, else false.

+

Returns true if string ends with target否则返回 false

示例

_.endsWith('abc', 'c');
@@ -13543,7 +13533,7 @@ 

示例

})();
-

escape source npm

+

escape source npm

_.escape([string=''])

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

示例

})();
-

escapeRegExp source npm

+

escapeRegExp source npm

_.escapeRegExp([string=''])

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

示例

})();
-

kebabCase source npm

+

kebabCase source npm

_.kebabCase([string=''])

Converts string to kebab case.

@@ -13711,7 +13701,7 @@

示例

})();
-

lowerCase source npm

+

lowerCase source npm

_.lowerCase([string=''])

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

@@ -13763,7 +13753,7 @@

示例

})();
-

lowerFirst source npm

+

lowerFirst source npm

_.lowerFirst([string=''])

Converts the first character of string to lower case.

@@ -13812,7 +13802,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. @@ -13869,7 +13859,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 @@ -13926,7 +13916,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 @@ -13983,7 +13973,7 @@

示例

})();
-

parseInt source npm

+

parseInt source npm

_.parseInt(string, [radix])

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

示例

})();
-

repeat source npm

+

repeat source npm

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

Repeats the given string n times.

@@ -14094,7 +14084,7 @@

示例

})();
-

replace source npm

+

replace source npm

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

Replaces matches for pattern in string with replacement. @@ -14147,7 +14137,7 @@

示例

})();
-

snakeCase source npm

+

snakeCase source npm

_.snakeCase([string=''])

Converts string to snake case.

@@ -14199,7 +14189,7 @@

示例

})();
-

split source npm

+

split source npm

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

Splits string by separator. @@ -14252,7 +14242,7 @@

示例

})();
-

startCase source npm

+

startCase source npm

_.startCase([string=''])

Converts string to start case.

@@ -14304,7 +14294,7 @@

示例

})();
-

startsWith source npm

+

startsWith source npm

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

Checks if string starts with the given target string.

@@ -14320,7 +14310,7 @@

参数

返回值 (boolean)

-

Returns true if string starts with target, else false.

+

Returns true if string starts with target否则返回 false

示例

_.startsWith('abc', 'a');
@@ -14360,7 +14350,7 @@ 

示例

})();
-

template source npm

+

template source npm

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

Creates a compiled template function that can interpolate data properties @@ -14498,7 +14488,7 @@

示例

})();
-

toLower source npm

+

toLower source npm

_.toLower([string=''])

Converts string, as a whole, to lower case.

@@ -14550,7 +14540,7 @@

示例

})();
-

toUpper source npm

+

toUpper source npm

_.toUpper([string=''])

Converts string, as a whole, to upper case.

@@ -14602,7 +14592,7 @@

示例

})();
-

trim source npm

+

trim source npm

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

Removes leading and trailing whitespace or specified characters from string.

@@ -14656,7 +14646,7 @@

示例

})();
-

trimEnd source npm

+

trimEnd source npm

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

Removes trailing whitespace or specified characters from string.

@@ -14707,7 +14697,7 @@

示例

})();
-

trimStart source npm

+

trimStart source npm

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

Removes leading whitespace or specified characters from string.

@@ -14758,7 +14748,7 @@

示例

})();
-

truncate source npm

+

truncate source npm

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

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

示例

})();
-

unescape source npm

+

unescape source npm

_.unescape([string=''])

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

示例

})();
-

upperCase source npm

+

upperCase source npm

_.upperCase([string=''])

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

@@ -14935,7 +14925,7 @@

示例

})();
-

upperFirst source npm

+

upperFirst source npm

_.upperFirst([string=''])

Converts the first character of string to upper case.

@@ -14984,7 +14974,7 @@

示例

})();
-

words source npm

+

words source npm

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

Splits string into an array of its words.

@@ -15035,7 +15025,7 @@

示例

})();
-

attempt source npm

+

attempt source npm

_.attempt(func)

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

示例

})();
-

bindAll source npm

+

bindAll source npm

_.bindAll(object, methodNames)

Binds methods of an object to the object itself, overwriting the existing @@ -15148,7 +15138,7 @@

示例

})();
-

cond source npm

+

cond source npm

_.cond(pairs)

Creates a function that iterates over pairs invoking the corresponding @@ -15209,12 +15199,12 @@

示例

})();
-

conforms source npm

+

conforms source npm

_.conforms(source)

Creates a function that invokes the predicate properties of source with the corresponding property values of a given object, returning true if -all predicates return truthy, else false.

+all predicates return truthy否则返回 false

参数

@@ -15262,7 +15252,7 @@

示例

})();
-

constant source npm

+

constant source npm

_.constant(value)

Creates a function that returns value.

@@ -15311,7 +15301,7 @@

示例

})();
-

flow source npm

+

flow source npm

_.flow([funcs])

Creates a function that returns the result of invoking the provided @@ -15364,7 +15354,7 @@

示例

})();
-

flowRight source npm

+

flowRight source npm

_.flowRight([funcs])

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

示例

})();
-

identity source npm

+

identity source npm

_.identity(value)

This method returns the first argument provided to it.

@@ -15464,7 +15454,7 @@

示例

})();
-

iteratee source npm

+

iteratee source npm

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

创建一个调用 func 的函数。 with the arguments of the created @@ -15531,12 +15521,12 @@

示例

})();
-

matches source npm

+

matches source npm

_.matches(source)

Creates a function that performs a deep partial comparison between a given object and source, returning true if the given object has equivalent -property values, else false. +property values否则返回 false

注意: This method supports comparing the same values as _.isEqual.

@@ -15587,12 +15577,12 @@

示例

})();
-

matchesProperty source npm

+

matchesProperty source npm

_.matchesProperty(path, srcValue)

Creates a function that performs a deep partial comparison between the value at path of a given object to srcValue, returning true if the -object value is equivalent, else false. +object value is equivalent否则返回 false

注意: This method supports comparing the same values as _.isEqual.

@@ -15645,7 +15635,7 @@

示例

})();
-

method source npm

+

method source npm

_.method(path, [args])

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

示例

})();
-

methodOf source npm

+

methodOf source npm

_.methodOf(object, [args])

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

示例

})();
-

mixin source npm

+

mixin source npm

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

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

示例

})();
-

noConflict source npm

+

noConflict source npm

_.noConflict()

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

示例

})();
-

noop source npm

+

noop source npm

_.noop()

A no-operation function that returns undefined regardless of the @@ -15912,7 +15902,7 @@

示例

})();
-

nthArg source npm

+

nthArg source npm

_.nthArg([n=0])

Creates a function that returns its nth argument.

@@ -15960,7 +15950,7 @@

示例

})();
-

over source npm

+

over source npm

_.over(iteratees)

Creates a function that invokes iteratees with the arguments provided @@ -16009,7 +15999,7 @@

示例

})();
-

overEvery source npm

+

overEvery source npm

_.overEvery(predicates)

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

示例

})();
-

overSome source npm

+

overSome source npm

_.overSome(predicates)

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

示例

})();
-

property source npm

+

property source npm

_.property(path)

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

@@ -16173,7 +16163,7 @@

示例

})();
-

propertyOf source npm

+

propertyOf source npm

_.propertyOf(object)

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

示例

})();
-

range source npm

+

range source npm

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

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

示例

})();
-

rangeRight source npm

+

rangeRight source npm

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

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

示例

})();
-

times source npm

+

times source npm

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

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

示例

})();
-

toPath source npm

+

toPath source npm

_.toPath(value)

Converts value to a property path array.

@@ -16549,7 +16539,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/assign.html b/assign.html index 0d0173e..00a462b 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 dcec7fa..242f1ad 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 b247d3f..9408db5 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 e53bf7e..64392a1 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 117ff21..ef8f601 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 0e839f9..d034e1d 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/bindAll.html b/bindAll.html index 2d6d463..3a35d1a 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/camelCase.html b/camelCase.html index f8b2f55..a6a6e01 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 2acea02..ea04a7f 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 c0cc36b..9fd3418 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/clamp.html b/clamp.html index d79c165..10c94c9 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 7222243..4302498 100644 --- a/clone.html +++ b/clone.html @@ -395,25 +395,25 @@

clone source npm

_.clone(value)
-

Creates a shallow clone of value. +

创建一个 value 的浅拷贝。

-注意: 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 are cloned -as plain objects. An empty object is returned for uncloneable values such -as error objects, functions, DOM nodes, and WeakMaps.

+以及支持 arrays、array buffers、 booleans、 date objects、maps、 +numbers, Object objects, regexes, sets, strings, symbols, 以及 typed +arrays。 +参数对象的可枚举属性会拷贝为普通对象。 +一些不可拷贝的对象,例如error objects、functions, DOM nodes, 以及 WeakMaps 会返回空对象。

参数

    -
  1. value (*)

    The value to clone.

    +
  2. value (*)

    要拷贝的值

返回值 (*)

-

Returns the cloned value.

+

返回拷贝后的值

示例

var users = [
diff --git a/cloneDeep.html b/cloneDeep.html
index 4e34ff1..97af283 100644
--- a/cloneDeep.html
+++ b/cloneDeep.html
@@ -392,19 +392,19 @@
 
 
-

cloneDeep source npm

+

cloneDeep source npm

_.cloneDeep(value)
-

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

+

这个方法类似 _.clone,除了它会递归拷贝 value

参数

    -
  1. value (*)

    The value to recursively clone.

    +
  2. value (*)

    要深拷贝的值

返回值 (*)

-

Returns the deep cloned value.

+

返回拷贝后的值

示例

var users = [
diff --git a/cloneDeepWith.html b/cloneDeepWith.html
index 655a240..2502e87 100644
--- a/cloneDeepWith.html
+++ b/cloneDeepWith.html
@@ -392,21 +392,21 @@
 
 
-

cloneDeepWith source npm

+

cloneDeepWith source npm

_.cloneDeepWith(value, [customizer])
-

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

+

这个方法类似 _.cloneWith,除了它会递归拷贝 value

参数

    -
  1. value (*)

    The value to recursively clone.

    +
  2. value (*)

    要深拷贝的值

  3. -
  4. [customizer] (Function)

    The function to customize cloning.

    +
  5. [customizer] (Function)

    这个函数定制返回的拷贝值

返回值 (*)

-

Returns the deep cloned value.

+

返回拷贝后的值

示例

function customizer(value) {
diff --git a/cloneWith.html b/cloneWith.html
index e757e87..3a60059 100644
--- a/cloneWith.html
+++ b/cloneWith.html
@@ -392,24 +392,23 @@
 
 
-

cloneWith source npm

+

cloneWith source npm

_.cloneWith(value, [customizer])
-

This method is like _.clone except that it accepts customizer which -is invoked to produce the cloned value. If customizer returns undefined -cloning is handled by the method instead. The customizer is invoked with -up to five arguments; (value [, index|key, object, stack]).

+

这个方法类似 _.clone,除了它接受一个 customizer 定制返回的拷贝值。 +如果 customizer 返回 undefined 将会拷贝处理方法代替。 +customizer 会传入5个参数:(value [, index|key, object, stack])

参数

    -
  1. value (*)

    The value to clone.

    +
  2. value (*)

    要拷贝的值

  3. -
  4. [customizer] (Function)

    The function to customize cloning.

    +
  5. [customizer] (Function)

    这个函数定制返回的拷贝值

返回值 (*)

-

Returns the cloned value.

+

返回拷贝后的值

示例

function customizer(value) {
diff --git a/cond.html b/cond.html
index 9e5eb2b..dabdc4a 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 ce15645..3db6b4e 100644 --- a/conforms.html +++ b/conforms.html @@ -392,12 +392,12 @@

-

conforms source npm

+

conforms source npm

_.conforms(source)

Creates a function that invokes the predicate properties of source with the corresponding property values of a given object, returning true if -all predicates return truthy, else false.

+all predicates return truthy否则返回 false

参数

diff --git a/constant.html b/constant.html index 0ad10c5..b7792fc 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/create.html b/create.html index 4c020ac..e881bc5 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/deburr.html b/deburr.html index bcd55a6..f8a28be 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 daaa0b6..d3b8fb9 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 16698ac..526a6e6 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/endsWith.html b/endsWith.html index be4c333..4025888 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.

@@ -408,7 +408,7 @@

参数

返回值 (boolean)

-

Returns true if string ends with target, else false.

+

Returns true if string ends with target否则返回 false

示例

_.endsWith('abc', 'c');
diff --git a/eq.html b/eq.html
index 40dfa1e..a815545 100644
--- a/eq.html
+++ b/eq.html
@@ -392,22 +392,21 @@
 
 
-

eq source npm

+

eq source npm

_.eq(value, other)
-

Performs a SameValueZero -comparison between two values to determine if they are equivalent.

+

执行 SameValueZero 比较两者的值确定它们是否相等。

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if the values are equivalent, else false.

+

相等返回 true,否则返回 false

示例

var object = { 'user': 'fred' };
diff --git a/escape.html b/escape.html
index d7e54d5..4c7cdbe 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 d4b6db1..91839f1 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/findKey.html b/findKey.html index ad6696c..3a5313d 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/findLastKey.html b/findLastKey.html index e76230a..0386e4e 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/floor.html b/floor.html index cc357c3..a609b8b 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 1c01ba8..fd60999 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 98afc4f..0899ca7 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/forIn.html b/forIn.html index e426063..1e24dbb 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 72dcfc6..5e4ed26 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 0188680..cda4f3d 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 6d3c61f..2724488 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/functions.html b/functions.html index c4c3af2..c8dad27 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 a7d5653..21a0647 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 477e747..10381bd 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/gt.html b/gt.html index b5813e7..bfd4569 100644 --- a/gt.html +++ b/gt.html @@ -392,21 +392,21 @@

-

gt source npm

+

gt source npm

_.gt(value, other)
-

Checks if value is greater than other.

+

检查 value 是否大于 other

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is greater than other, else false.

+

如果 value 大于 other,返回 true,否则返回 false

示例

_.gt(3, 1);
diff --git a/gte.html b/gte.html
index 6e52ae5..f5c255c 100644
--- a/gte.html
+++ b/gte.html
@@ -392,21 +392,21 @@
 
 
-

gte source npm

+

gte source npm

_.gte(value, other)
-

Checks if value is greater than or equal to other.

+

检查 value 是否大于等于 other

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is greater than or equal to other, else false.

+

如果 value 大于等于 other,返回 true,否则返回 false

示例

_.gte(3, 1);
diff --git a/has.html b/has.html
index 2510de1..026bb4a 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.

@@ -406,7 +406,7 @@

参数

返回值 (boolean)

-

Returns true if path exists, else false.

+

Returns true if path exists否则返回 false

示例

var object = { 'a': { 'b': { 'c': 3 } } };
diff --git a/hasIn.html b/hasIn.html
index 8374c40..08cd983 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.

@@ -406,7 +406,7 @@

参数

返回值 (boolean)

-

Returns true if path exists, else false.

+

Returns true if path exists否则返回 false

示例

var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
diff --git a/identity.html b/identity.html
index 3d6d657..cda9080 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 e4e3006..c84840a 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 @@ -411,7 +411,7 @@

参数

返回值 (boolean)

-

Returns true if number is in the range, else false.

+

Returns true if number is in the range否则返回 false

示例

_.inRange(3, 2, 4);
diff --git a/index.html b/index.html
index 3ac4978..af70b51 100644
--- a/index.html
+++ b/index.html
@@ -464,7 +464,7 @@ 

特点

关于翻译

    -
  • 该文档由 think2011 翻译,遵循 MIT协议, 保持与官方同步,翻译质量可能没法特别好,但会保证尽可能反复细心。
  • +
  • 该文档由 think2011 翻译,遵循 MIT协议, 定时保持与官方同步,翻译质量可能没法特别好,但会保证尽可能反复细心。
  • 如果您有任何建议,或者意见,欢迎在此讨论,及时更正 ;-)
diff --git a/invert.html b/invert.html index 0578d90..c8dca7b 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 082af3f..794920b 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/isArguments.html b/isArguments.html index 518ce52..f59ce0d 100644 --- a/isArguments.html +++ b/isArguments.html @@ -392,19 +392,19 @@
-

isArguments source npm

+

isArguments source npm

_.isArguments(value)
-

Checks if value is likely an arguments object.

+

检查 value 是否是 类 arguments 对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isArguments(function() { return arguments; }());
diff --git a/isArray.html b/isArray.html
index 20f2552..7175806 100644
--- a/isArray.html
+++ b/isArray.html
@@ -392,19 +392,19 @@
 
 
-

isArray source npm

+

isArray source npm

_.isArray(value)
-

Checks if value is classified as an Array object.

+

检查 value 是否是 Array 类对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isArray([1, 2, 3]);
diff --git a/isArrayLike.html b/isArrayLike.html
index 95126d7..af6e56b 100644
--- a/isArrayLike.html
+++ b/isArrayLike.html
@@ -392,21 +392,20 @@
 
 
-

isArrayLike source npm

+

isArrayLike source npm

_.isArrayLike(value)
-

Checks if value is array-like. A value is considered array-like if it's -not a function and has a value.length that's an integer greater than or -equal to 0 and less than or equal to Number.MAX_SAFE_INTEGER.

+

检查 value 是否是类数组。 +如果是类数组的话,应该不是一个函数,而且 value.length 是个整数,大于等于 0,小于或等于 Number.MAX_SAFE_INTEGER

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is array-like, else false.

+

如果是类数组,返回 true,否则返回 false

示例

_.isArrayLike([1, 2, 3]);
diff --git a/isArrayLikeObject.html b/isArrayLikeObject.html
index ffaee68..c964f94 100644
--- a/isArrayLikeObject.html
+++ b/isArrayLikeObject.html
@@ -392,20 +392,19 @@
 
 
-

isArrayLikeObject source npm

+

isArrayLikeObject source npm

_.isArrayLikeObject(value)
-

This method is like _.isArrayLike except that it also checks if value -is an object.

+

这个方法类似 _.isArrayLike,除了它还检查值是否是个对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an array-like object, else false.

+

如果是类数组对象,返回 true,否则返回 false

示例

_.isArrayLikeObject([1, 2, 3]);
diff --git a/isBoolean.html b/isBoolean.html
index da43f65..bb94632 100644
--- a/isBoolean.html
+++ b/isBoolean.html
@@ -392,19 +392,19 @@
 
 
-

isBoolean source npm

+

isBoolean source npm

_.isBoolean(value)
-

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

+

检查 value 是否是原始 boolean 类型或者对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isBoolean(false);
diff --git a/isDate.html b/isDate.html
index 5b5b41b..1cc258d 100644
--- a/isDate.html
+++ b/isDate.html
@@ -392,19 +392,19 @@
 
 
-

isDate source npm

+

isDate source npm

_.isDate(value)
-

Checks if value is classified as a Date object.

+

检查 value 是否是 Date 类型

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isDate(new Date);
diff --git a/isElement.html b/isElement.html
index 9fd0efc..e9cac3c 100644
--- a/isElement.html
+++ b/isElement.html
@@ -392,19 +392,19 @@
 
 
-

isElement source npm

+

isElement source npm

_.isElement(value)
-

Checks if value is likely a DOM element.

+

检查 value 是否是可能是 DOM 元素

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a DOM element, else false.

+

如果是 DOM 元素返回 true,否则返回 false

示例

_.isElement(document.body);
diff --git a/isEmpty.html b/isEmpty.html
index 22d730d..9eb29c3 100644
--- a/isEmpty.html
+++ b/isEmpty.html
@@ -392,21 +392,20 @@
 
 
-

isEmpty source npm

+

isEmpty source npm

_.isEmpty(value)
-

Checks if value is empty. A value is considered empty unless it's an -arguments object, array, string, or jQuery-like collection with a length -greater than 0 or an object with own enumerable properties.

+

检查 value 是否为空。 +判断的依据是除非是有枚举属性的对象,length 大于 0arguments object, array, string 或类jquery选择器。

参数

    -
  1. value (Array|Object|string)

    The value to inspect.

    +
  2. value (Array|Object|string)

    要检查的值

返回值 (boolean)

-

Returns true if value is empty, else false.

+

如果为空返回 true,否则返回 false

示例

_.isEmpty(null);
diff --git a/isEqual.html b/isEqual.html
index eb5cb1f..f692eab 100644
--- a/isEqual.html
+++ b/isEqual.html
@@ -392,29 +392,27 @@
 
 
-

isEqual source npm

+

isEqual source npm

_.isEqual(value, other)
-

Performs a deep comparison between two values to determine if they are -equivalent. +

执行深比较来决定两者的值是否相等。

-注意: This method supports comparing arrays, array buffers, booleans, +注意: 这个方法支持比较 arrays, array buffers, booleans, date objects, error objects, maps, numbers, Object objects, regexes, -sets, strings, symbols, and typed arrays. Object objects are compared -by their own, not inherited, enumerable properties. Functions and DOM -nodes are not supported.

+sets, strings, symbols, 以及 typed arrays. Object 对象值比较自身的属性,不包括继承的和可枚举的属性。 +不支持函数和DOM节点。

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if the values are equivalent, else false.

+

如果相等返回 true,否则返回 false

示例

var object = { 'user': 'fred' };
diff --git a/isEqualWith.html b/isEqualWith.html
index 3dbe3b8..cf1fe3f 100644
--- a/isEqualWith.html
+++ b/isEqualWith.html
@@ -392,26 +392,25 @@
 
 
-

isEqualWith source npm

+

isEqualWith source npm

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

This method is like _.isEqual except that it accepts customizer which is -invoked to compare values. If customizer returns undefined comparisons are -handled by the method instead. The customizer is invoked with up to seven arguments:
-(objValue, othValue [, index|key, object, other, stack]).

+

这个方法类似 _.isEqual。 +除了它接受一个 customizer 定制比较值。 如果 customizer 返回 undefined 将会比较处理方法代替。 +customizer 会传入7个参数:(objValue, othValue [, index|key, object, other, stack])

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

  6. -
  7. [customizer] (Function)

    The function to customize comparisons.

    +
  8. [customizer] (Function)

    这个函数定制比较值

返回值 (boolean)

-

Returns true if the values are equivalent, else false.

+

如果相等返回 true,否则返回 false

示例

function isGreeting(value) {
diff --git a/isError.html b/isError.html
index ab793d9..cf45418 100644
--- a/isError.html
+++ b/isError.html
@@ -392,20 +392,20 @@
 
 
-

isError source npm

+

isError source npm

_.isError(value)
-

Checks if value is an Error, EvalError, RangeError, ReferenceError, -SyntaxError, TypeError, or URIError object.

+

检查 value 是否是 Error, EvalError, RangeError, ReferenceError, +SyntaxError, TypeError, 或 URIError object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an error object, else false.

+

如果是 error object 返回 true,否则返回 false

示例

_.isError(new Error);
diff --git a/isFinite.html b/isFinite.html
index 12fe089..1a19cae 100644
--- a/isFinite.html
+++ b/isFinite.html
@@ -392,22 +392,22 @@
 
 
-

isFinite source npm

+

isFinite source npm

_.isFinite(value)
-

Checks if value is a finite primitive number. +

检查 value 是否是原始 finite number。

-注意: This method is based on Number.isFinite.

+注意: 这个方法基于 Number.isFinite.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a finite number, else false.

+

如果是 finite number 返回 true,否则返回 false

示例

_.isFinite(3);
diff --git a/isFunction.html b/isFunction.html
index 688128a..f980fee 100644
--- a/isFunction.html
+++ b/isFunction.html
@@ -392,19 +392,19 @@
 
 
-

isFunction source npm

+

isFunction source npm

_.isFunction(value)
-

Checks if value is classified as a Function object.

+

检查 value 是否是 Function 对象。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isFunction(_);
diff --git a/isInteger.html b/isInteger.html
index bf324a9..9476df2 100644
--- a/isInteger.html
+++ b/isInteger.html
@@ -392,22 +392,22 @@
 
 
-

isInteger source npm

+

isInteger source npm

_.isInteger(value)
-

Checks if value is an integer. +

检查 value 是否是整数。

-注意: This method is based on Number.isInteger.

+注意: 这个方法基于 Number.isInteger.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an integer, else false.

+

如果是整数返回 true,否则返回 false

示例

_.isInteger(3);
diff --git a/isLength.html b/isLength.html
index 49452e9..611d900 100644
--- a/isLength.html
+++ b/isLength.html
@@ -392,22 +392,22 @@
 
 
-

isLength source npm

+

isLength source npm

_.isLength(value)
-

Checks if value is a valid array-like length. +

检查 value 是否是有效长度

-注意: This function is loosely based on ToLength.

+注意: 这个方法参考自 ToLength.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a valid length, else false.

+

如果是有效长度返回 true,否则返回 false

示例

_.isLength(3);
diff --git a/isMatch.html b/isMatch.html
index f52c10f..2f17298 100644
--- a/isMatch.html
+++ b/isMatch.html
@@ -392,25 +392,24 @@
 
 
-

isMatch source npm

+

isMatch source npm

_.isMatch(object, source)
-

Performs a deep comparison between object and source to determine if -object contains equivalent property values. +

执行一个深比较来确定object 是否包含有 source 的属性值。

-注意: This method supports comparing the same values as _.isEqual.

+注意: 这个方法支持比较相同的值和 _.isEqual 一样

参数

    -
  1. object (Object)

    The object to inspect.

    +
  2. object (Object)

    要检查的值

  3. -
  4. source (Object)

    The object of property values to match.

    +
  5. source (Object)

    匹配包含在 object 的对象

返回值 (boolean)

-

Returns true if object is a match, else false.

+

如果匹配返回 true,否则返回 false

示例

var object = { 'user': 'fred', 'age': 40 };
diff --git a/isMatchWith.html b/isMatchWith.html
index 06a1a8f..87d3b06 100644
--- a/isMatchWith.html
+++ b/isMatchWith.html
@@ -392,26 +392,25 @@
 
 
-

isMatchWith source npm

+

isMatchWith source npm

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

This method is like _.isMatch except that it accepts customizer which -is invoked to compare values. If customizer returns undefined comparisons -are handled by the method instead. The customizer is invoked with three -arguments: (objValue, srcValue, index|key, object, source).

+

这个方法类似 _.isMatch。 +除了它接受一个 customizer 定制比较的值。 +如果 customizer 返回 undefined 将会比较处理方法代替。 customizer 会传入5个参数:(objValue, srcValue, index|key, object, source)

参数

    -
  1. object (Object)

    The object to inspect.

    +
  2. object (Object)

    要检查的值

  3. -
  4. source (Object)

    The object of property values to match.

    +
  5. source (Object)

    匹配包含在 object 的对象

  6. -
  7. [customizer] (Function)

    The function to customize comparisons.

    +
  8. [customizer] (Function)

    这个函数定制比较值

返回值 (boolean)

-

Returns true if object is a match, else false.

+

如果匹配返回 true,否则返回 false

示例

function isGreeting(value) {
diff --git a/isNaN.html b/isNaN.html
index 6a1bc11..d520de0 100644
--- a/isNaN.html
+++ b/isNaN.html
@@ -392,23 +392,23 @@
 
 
-

isNaN source npm

+

isNaN source npm

_.isNaN(value)
-

Checks if value is NaN. +

检查 value 是否是 NaN.

-注意: This method is not the same as isNaN -which returns true for undefined and other non-numeric values.

+注意: 这个方法不同于 isNaN +对 undefind 和 其他非数值返回 true.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is NaN, else false.

+

如果符合 NaN 返回 true,否则返回 false

示例

_.isNaN(NaN);
diff --git a/isNative.html b/isNative.html
index 7d430da..c1d275f 100644
--- a/isNative.html
+++ b/isNative.html
@@ -392,19 +392,19 @@
 
 
-

isNative source npm

+

isNative source npm

_.isNative(value)
-

Checks if value is a native function.

+

检查 value 是否是原生函数

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a native function, else false.

+

如果是原生函数返回 true,否则返回 false

示例

_.isNative(Array.prototype.push);
diff --git a/isNil.html b/isNil.html
index af54412..75a5373 100644
--- a/isNil.html
+++ b/isNil.html
@@ -392,19 +392,19 @@
 
 
-

isNil source npm

+

isNil source npm

_.isNil(value)
-

Checks if value is null or undefined.

+

检查 value 是否是 null 或者 undefined

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is nullish, else false.

+

如果是 null 或者 undefined 返回 true,否则返回 false

示例

_.isNil(null);
diff --git a/isNull.html b/isNull.html
index 0d805a2..918469a 100644
--- a/isNull.html
+++ b/isNull.html
@@ -392,19 +392,19 @@
 
 
-

isNull source npm

+

isNull source npm

_.isNull(value)
-

Checks if value is null.

+

检查 value 是否是 null.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is null, else false.

+

如果是 null 返回 true,否则返回 false

示例

_.isNull(null);
diff --git a/isNumber.html b/isNumber.html
index 88594f8..7a3c6bc 100644
--- a/isNumber.html
+++ b/isNumber.html
@@ -392,10 +392,10 @@
 
 
-

isNumber source npm

+

isNumber source npm

_.isNumber(value)
-

Checks if value is classified as a Number primitive or object. +

检查 value 是否是 as a Number primitive or object.

注意: To exclude Infinity, -Infinity, and NaN, which are classified @@ -404,11 +404,11 @@

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isNumber(3);
diff --git a/isObject.html b/isObject.html
index 8a901f0..95b0b2f 100644
--- a/isObject.html
+++ b/isObject.html
@@ -392,20 +392,20 @@
 
 
-

isObject source npm

+

isObject source npm

_.isObject(value)
-

Checks if value is the language type of Object. -(e.g. arrays, functions, objects, regexes, new Number(0), and new String(''))

+

检查 value 是否是 Objectlanguage type。 +(例如: arrays, functions, objects, regexes, new Number(0), 以及 new String(''))

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is an object, else false.

+

如果是对象返回 true,否则返回 false

示例

_.isObject({});
diff --git a/isObjectLike.html b/isObjectLike.html
index e6f8c4c..b0dc2e8 100644
--- a/isObjectLike.html
+++ b/isObjectLike.html
@@ -392,20 +392,20 @@
 
 
-

isObjectLike source npm

+

isObjectLike source npm

_.isObjectLike(value)
-

Checks if value is object-like. A value is object-like if it's not null -and has a typeof result of "object".

+

检查 value 是否是 类对象。 +类对象应该不是 null 以及 typeof 的结果是 "object"。

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is object-like, else false.

+

如果是类对象返回 true,否则返回 false

示例

_.isObjectLike({});
diff --git a/isPlainObject.html b/isPlainObject.html
index 3c7ed07..bf20857 100644
--- a/isPlainObject.html
+++ b/isPlainObject.html
@@ -392,20 +392,20 @@
 
 
-

isPlainObject source npm

+

isPlainObject source npm

_.isPlainObject(value)
-

Checks if value is a plain object, that is, an object created by the +

检查 value 是否是 a plain object, that is, an object created by the Object constructor or one with a [[Prototype]] of null.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a plain object, else false.

+

Returns true if value is a plain object否则返回 false

示例

function Foo() {
diff --git a/isRegExp.html b/isRegExp.html
index 76b5bc4..7824fff 100644
--- a/isRegExp.html
+++ b/isRegExp.html
@@ -392,19 +392,19 @@
 
 
-

isRegExp source npm

+

isRegExp source npm

_.isRegExp(value)
-

Checks if value is classified as a RegExp object.

+

检查 value 是否是 as a RegExp object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isRegExp(/abc/);
diff --git a/isSafeInteger.html b/isSafeInteger.html
index b399079..803066d 100644
--- a/isSafeInteger.html
+++ b/isSafeInteger.html
@@ -392,10 +392,10 @@
 
 
-

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 +

检查 value 是否是 a safe integer. An integer is safe if it's an IEEE-754 double precision number which isn't the result of a rounded unsafe integer.

@@ -404,11 +404,11 @@

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is a safe integer, else false.

+

Returns true if value is a safe integer否则返回 false

示例

_.isSafeInteger(3);
diff --git a/isString.html b/isString.html
index 20a4a88..107663d 100644
--- a/isString.html
+++ b/isString.html
@@ -392,19 +392,19 @@
 
 
-

isString source npm

+

isString source npm

_.isString(value)
-

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

+

检查 value 是否是 as a String primitive or object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isString('abc');
diff --git a/isSymbol.html b/isSymbol.html
index d46b737..e9b903a 100644
--- a/isSymbol.html
+++ b/isSymbol.html
@@ -392,19 +392,19 @@
 
 
-

isSymbol source npm

+

isSymbol source npm

_.isSymbol(value)
-

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

+

检查 value 是否是 as a Symbol primitive or object.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isSymbol(Symbol.iterator);
diff --git a/isTypedArray.html b/isTypedArray.html
index 9ce3f57..a0084e0 100644
--- a/isTypedArray.html
+++ b/isTypedArray.html
@@ -392,19 +392,19 @@
 
 
-

isTypedArray source npm

+

isTypedArray source npm

_.isTypedArray(value)
-

Checks if value is classified as a typed array.

+

检查 value 是否是 as a typed array.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is correctly classified, else false.

+

如果是正确的类型,返回 true,否则返回 false

示例

_.isTypedArray(new Uint8Array);
diff --git a/isUndefined.html b/isUndefined.html
index 8d3b7d1..2214573 100644
--- a/isUndefined.html
+++ b/isUndefined.html
@@ -392,19 +392,19 @@
 
 
-

isUndefined source npm

+

isUndefined source npm

_.isUndefined(value)
-

Checks if value is undefined.

+

检查 value 是否是 undefined.

参数

    -
  1. value (*)

    The value to check.

    +
  2. value (*)

    要检查的值

返回值 (boolean)

-

Returns true if value is undefined, else false.

+

Returns true if value is undefined否则返回 false

示例

_.isUndefined(void 0);
diff --git a/iteratee.html b/iteratee.html
index fb3a11c..517a680 100644
--- a/iteratee.html
+++ b/iteratee.html
@@ -392,7 +392,7 @@
 
 
-

iteratee source npm

+

iteratee source npm

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

创建一个调用 func 的函数。 with the arguments of the created diff --git a/js/lodash-zh.js b/js/lodash-zh.js index 9982fc5..89099c4 100644 --- a/js/lodash-zh.js +++ b/js/lodash-zh.js @@ -470,7 +470,7 @@ * @private * @param {Array} array The array to iterate over. * @param {Function} predicate 这个函数会处理每一个元素 - * @returns {boolean} Returns `true` if all elements pass the predicate check, else `false`. + * @returns {boolean} Returns `true` if all elements pass the predicate check否则返回 `false` */ function arrayEvery (array, predicate) { var index = -1, @@ -515,7 +515,7 @@ * @private * @param {Array} array The array to search. * @param {*} target 要检索的值 - * @returns {boolean} Returns `true` if `target` is found, else `false`. + * @returns {boolean} Returns `true` if `target` is found否则返回 `false` */ function arrayIncludes (array, value) { return !!array.length && baseIndexOf(array, value, 0) > -1; @@ -529,7 +529,7 @@ * @param {Array} array The array to search. * @param {*} target 要检索的值 * @param {Function} comparator 这个函数会处理每一个元素 - * @returns {boolean} Returns `true` if `target` is found, else `false`. + * @returns {boolean} Returns `true` if `target` is found否则返回 `false` */ function arrayIncludesWith (array, value, comparator) { var index = -1, @@ -635,7 +635,7 @@ * @private * @param {Array} array The array to iterate over. * @param {Function} predicate 这个函数会处理每一个元素 - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @returns {boolean} Returns `true` if any element passes the predicate check否则返回 `false` */ function arraySome (array, predicate) { var index = -1, @@ -924,10 +924,10 @@ } /** - * Checks if `value` is a global object. + * 检查 `value` 是否是 a global object. * * @private - * @param {*} value The value to check. + * @param {*} value 要检查的值 * @returns {null|Object} Returns `value` if it's a global object, else `null`. */ function checkGlobal (value) { @@ -938,8 +938,8 @@ * Compares values to sort them in ascending order. * * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 * @returns {number} Returns the sort order indicator for `value`. */ function compareAscending (value, other) { @@ -1063,11 +1063,11 @@ } /** - * Checks if `value` is a host object in IE < 9. + * 检查 `value` 是否是 a host object in IE < 9. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} Returns `true` if `value` is a host object否则返回 `false` */ function isHostObject (value) { // Many host objects are `Object` objects that can coerce to strings @@ -1083,12 +1083,12 @@ } /** - * Checks if `value` is a valid array-like index. + * 检查 `value` 是否是 a valid array-like index. * * @private - * @param {*} value The value to check. + * @param {*} value 要检查的值 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + * @returns {boolean} Returns `true` if `value` is a valid index否则返回 `false` */ function isIndex (value, length) { value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; @@ -1102,7 +1102,7 @@ * * @private * @param {number} charCode The character code to inspect. - * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`. + * @returns {boolean} Returns `true` if `charCode` is whitespace否则返回 `false` */ function isSpace (charCode) { return ((charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160) || charCode == 5760 || charCode == 6158 || @@ -1714,7 +1714,7 @@ * @private * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @returns {boolean} Returns `true` if the entry was removed否则返回 `false` */ function hashDelete (hash, key) { return hashHas(hash, key) && delete hash[key]; @@ -1742,7 +1742,7 @@ * @private * @param {Object} hash The hash to query. * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @returns {boolean} Returns `true` if an entry for `key` exists否则返回 `false` */ function hashHas (hash, key) { return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); @@ -1797,7 +1797,7 @@ * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @returns {boolean} Returns `true` if the entry was removed否则返回 `false` */ function mapDelete (key) { var data = this.__data__; @@ -1831,7 +1831,7 @@ * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @returns {boolean} Returns `true` if an entry for `key` exists否则返回 `false` */ function mapHas (key) { var data = this.__data__; @@ -1883,12 +1883,12 @@ } /** - * Checks if `value` is in `cache`. + * 检查 `value` 是否是 in `cache`. * * @private * @param {Object} cache The set cache to search. * @param {*} value 要检索的值 - * @returns {number} Returns `true` if `value` is found, else `false`. + * @returns {number} Returns `true` if `value` is found否则返回 `false` */ function cacheHas (cache, value) { var map = cache.__data__; @@ -1959,7 +1959,7 @@ * @name delete * @memberOf Stack * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @returns {boolean} Returns `true` if the entry was removed否则返回 `false` */ function stackDelete (key) { var data = this.__data__, @@ -1991,7 +1991,7 @@ * @name has * @memberOf Stack * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @returns {boolean} Returns `true` if an entry for `key` exists否则返回 `false` */ function stackHas (key) { var data = this.__data__, @@ -2037,7 +2037,7 @@ * @private * @param {Array} array The array to query. * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. + * @returns {boolean} Returns `true` if the entry was removed否则返回 `false` */ function assocDelete (array, key) { var index = assocIndexOf(array, key); @@ -2072,7 +2072,7 @@ * @private * @param {Array} array The array to query. * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + * @returns {boolean} Returns `true` if an entry for `key` exists否则返回 `false` */ function assocHas (array, key) { return assocIndexOf(array, key) > -1; @@ -2618,7 +2618,7 @@ * @private * @param {Object} object The object to query. * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. + * @returns {boolean} Returns `true` if `key` exists否则返回 `false` */ function baseHas (object, key) { // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, @@ -2634,7 +2634,7 @@ * @private * @param {Object} object The object to query. * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. + * @returns {boolean} Returns `true` if `key` exists否则返回 `false` */ function baseHasIn (object, key) { return key in Object(object); @@ -2720,15 +2720,15 @@ * and tracks traversed objects. * * @private - * @param {*} value The value to compare. - * @param {*} other The other value to compare. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 * @param {Function} [customizer] The function to customize comparisons. * @param {boolean} [bitmask] The bitmask of comparison flags. * The bitmask may be composed of the following flags: * 1 - Unordered comparison * 2 - Partial comparison * @param {Object} [stack] Tracks traversed `value` and `other` objects. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @returns {boolean} Returns `true` if the values are equivalent否则返回 `false` */ function baseIsEqual (value, other, customizer, bitmask, stack) { if (value === other) { @@ -2752,7 +2752,7 @@ * @param {Function} [customizer] The function to customize comparisons. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @returns {boolean} Returns `true` if the objects are equivalent否则返回 `false` */ function baseIsEqualDeep (object, other, equalFunc, customizer, bitmask, stack) { var objIsArr = isArray(object), @@ -2818,7 +2818,7 @@ * @param {Object} source The object of property values to match. * @param {Array} matchData The property names, values, and compare flags to match. * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @returns {boolean} Returns `true` if `object` is a match否则返回 `false` */ function baseIsMatch (object, source, matchData, customizer) { var index = matchData.length, @@ -3372,7 +3372,7 @@ * @private * @param {Array|Object} collection 需要遍历的集合 * @param {Function} predicate 这个函数会处理每一个元素 - * @returns {boolean} Returns `true` if any element passes the predicate check, else `false`. + * @returns {boolean} Returns `true` if any element passes the predicate check否则返回 `false` */ function baseSome (collection, predicate) { var result; @@ -3582,7 +3582,7 @@ * @private * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @returns {boolean} Returns `true` if the property is deleted否则返回 `false` */ function baseUnset (object, path) { path = isKey(path, object) ? [path + ''] : baseToPath(path); @@ -4487,7 +4487,7 @@ * @param {Function} [customizer] The function to customize comparisons. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {Object} [stack] Tracks traversed `array` and `other` objects. - * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + * @returns {boolean} Returns `true` if the arrays are equivalent否则返回 `false` */ function equalArrays (array, other, equalFunc, customizer, bitmask, stack) { var index = -1, @@ -4543,7 +4543,7 @@ * @param {Function} equalFunc The function to determine equivalents of values. * @param {Function} [customizer] The function to customize comparisons. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @returns {boolean} Returns `true` if the objects are equivalent否则返回 `false` */ function equalByTag (object, other, tag, equalFunc, customizer, bitmask) { switch (tag) { @@ -4600,7 +4600,7 @@ * @param {Function} [customizer] The function to customize comparisons. * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` for more details. * @param {Object} [stack] Tracks traversed `object` and `other` objects. - * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + * @returns {boolean} Returns `true` if the objects are equivalent否则返回 `false` */ function equalObjects (object, other, equalFunc, customizer, bitmask, stack) { var isPartial = bitmask & PARTIAL_COMPARE_FLAG, @@ -4830,7 +4830,7 @@ * @param {Object} object The object to query. * @param {Array|string} path The path to check. * @param {Function} hasFunc The function to check properties. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @returns {boolean} Returns `true` if `path` exists否则返回 `false` */ function hasPath (object, path, hasFunc) { if (object == null) { @@ -4953,7 +4953,7 @@ * @param {*} value The potential iteratee value argument. * @param {*} index The potential iteratee index or key argument. * @param {*} object The potential iteratee object argument. - * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call否则返回 `false` */ function isIterateeCall (value, index, object) { if (!isObject(object)) { @@ -4969,12 +4969,12 @@ } /** - * Checks if `value` is a property name and not a property path. + * 检查 `value` 是否是 a property name and not a property path. * * @private - * @param {*} value The value to check. + * @param {*} value 要检查的值 * @param {Object} [object] The object to query keys on. - * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + * @returns {boolean} Returns `true` if `value` is a property name否则返回 `false` */ function isKey (value, object) { if (typeof value == 'number') { @@ -4986,11 +4986,11 @@ } /** - * Checks if `value` is suitable for use as unique object key. + * 检查 `value` 是否是 suitable for use as unique object key. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} Returns `true` if `value` is suitable否则返回 `false` */ function isKeyable (value) { var type = typeof value; @@ -5003,7 +5003,7 @@ * * @private * @param {Function} func The function to check. - * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart否则返回 `false` */ function isLaziable (func) { var funcName = getFuncName(func), @@ -5020,11 +5020,11 @@ } /** - * Checks if `value` is likely a prototype object. + * 检查 `value` 是否是 likely a prototype object. * * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} Returns `true` if `value` is a prototype否则返回 `false` */ function isPrototype (value) { var Ctor = value && value.constructor, @@ -5034,12 +5034,12 @@ } /** - * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * 检查 `value` 是否是 suitable for strict equality comparisons, i.e. `===`. * * @private - * @param {*} value The value to check. + * @param {*} value 要检查的值 * @returns {boolean} Returns `true` if `value` if suitable for strict - * equality comparisons, else `false`. + * equality comparisons否则返回 `false` */ function isStrictComparable (value) { return value === value && !isObject(value); @@ -8955,21 +8955,21 @@ /*------------------------------------------------------------------------*/ /** - * Creates a shallow clone of `value`. + * 创建一个 `value` 的浅拷贝。 * - * **注意:** This method is loosely based on the + * **注意:** 这个方法参考自 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) - * and supports cloning arrays, array buffers, booleans, date objects, maps, - * numbers, `Object` objects, regexes, sets, strings, symbols, and typed - * arrays. The own enumerable properties of `arguments` objects are cloned - * as plain objects. An empty object is returned for uncloneable values such - * as error objects, functions, DOM nodes, and WeakMaps. + * 以及支持 arrays、array buffers、 booleans、 date objects、maps、 + * numbers, `Object` objects, regexes, sets, strings, symbols, 以及 typed + * arrays。 + * 参数对象的可枚举属性会拷贝为普通对象。 + * 一些不可拷贝的对象,例如error objects、functions, DOM nodes, 以及 WeakMaps 会返回空对象。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to clone. - * @returns {*} Returns the cloned value. + * @param {*} value 要拷贝的值 + * @returns {*} 返回拷贝后的值 * @example * * var users = [ @@ -8986,17 +8986,16 @@ } /** - * This method is like `_.clone` except that it accepts `customizer` which - * is invoked to produce the cloned value. If `customizer` returns `undefined` - * cloning is handled by the method instead. The `customizer` is invoked with - * up to five arguments; (value [, index|key, object, stack]). + * 这个方法类似 `_.clone`,除了它接受一个 `customizer` 定制返回的拷贝值。 + * 如果 `customizer` 返回 `undefined` 将会拷贝处理方法代替。 + * `customizer` 会传入5个参数:(value [, index|key, object, stack]) * * @static * @memberOf _ * @category Lang - * @param {*} value The value to clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the cloned value. + * @param {*} value 要拷贝的值 + * @param {Function} [customizer] 这个函数定制返回的拷贝值 + * @returns {*} 返回拷贝后的值 * @example * * function customizer(value) { @@ -9019,13 +9018,13 @@ } /** - * This method is like `_.clone` except that it recursively clones `value`. + * 这个方法类似 `_.clone`,除了它会递归拷贝 `value`。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to recursively clone. - * @returns {*} Returns the deep cloned value. + * @param {*} value 要深拷贝的值 + * @returns {*} 返回拷贝后的值 * @example * * var users = [ @@ -9042,14 +9041,14 @@ } /** - * This method is like `_.cloneWith` except that it recursively clones `value`. + * 这个方法类似 `_.cloneWith`,除了它会递归拷贝 `value`。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to recursively clone. - * @param {Function} [customizer] The function to customize cloning. - * @returns {*} Returns the deep cloned value. + * @param {*} value 要深拷贝的值 + * @param {Function} [customizer] 这个函数定制返回的拷贝值 + * @returns {*} 返回拷贝后的值 * @example * * function customizer(value) { @@ -9072,15 +9071,14 @@ } /** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. + * 执行 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) 比较两者的值确定它们是否相等。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 + * @returns {boolean} 相等返回 `true`,否则返回 `false` * @example * * var object = { 'user': 'fred' }; @@ -9106,14 +9104,14 @@ } /** - * Checks if `value` is greater than `other`. + * 检查 `value` 是否大于 `other` * * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 + * @returns {boolean} 如果 `value` 大于 `other`,返回 `true`,否则返回 `false` * @example * * _.gt(3, 1); @@ -9130,14 +9128,14 @@ } /** - * Checks if `value` is greater than or equal to `other`. + * 检查 `value` 是否大于等于 `other` * * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 + * @returns {boolean} 如果 `value` 大于等于 `other`,返回 `true`,否则返回 `false` * @example * * _.gte(3, 1); @@ -9154,13 +9152,13 @@ } /** - * Checks if `value` is likely an `arguments` object. + * 检查 `value` 是否是 类 `arguments` 对象。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isArguments(function() { return arguments; }()); @@ -9176,14 +9174,14 @@ } /** - * Checks if `value` is classified as an `Array` object. + * 检查 `value` 是否是 `Array` 类对象。 * * @static * @memberOf _ * @type Function * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isArray([1, 2, 3]); @@ -9201,16 +9199,15 @@ var isArray = Array.isArray; /** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * 检查 `value` 是否是类数组。 + * 如果是类数组的话,应该不是一个函数,而且 `value.length` 是个整数,大于等于 0,小于或等于 `Number.MAX_SAFE_INTEGER` * * @static * @memberOf _ * @type Function * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是类数组,返回 `true`,否则返回 `false` * @example * * _.isArrayLike([1, 2, 3]); @@ -9230,15 +9227,14 @@ } /** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. + * 这个方法类似 `_.isArrayLike`,除了它还检查值是否是个对象。 * * @static * @memberOf _ * @type Function * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是类数组对象,返回 `true`,否则返回 `false` * @example * * _.isArrayLikeObject([1, 2, 3]); @@ -9258,13 +9254,13 @@ } /** - * Checks if `value` is classified as a boolean primitive or object. + * 检查 `value` 是否是原始 boolean 类型或者对象。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isBoolean(false); @@ -9279,13 +9275,13 @@ } /** - * Checks if `value` is classified as a `Date` object. + * 检查 `value` 是否是 `Date` 类型 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isDate(new Date); @@ -9299,13 +9295,13 @@ } /** - * Checks if `value` is likely a DOM element. + * 检查 `value` 是否是可能是 DOM 元素 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是 DOM 元素返回 `true`,否则返回 `false` * @example * * _.isElement(document.body); @@ -9319,15 +9315,14 @@ } /** - * Checks if `value` is empty. A value is considered empty unless it's an - * `arguments` object, array, string, or jQuery-like collection with a length - * greater than `0` or an object with own enumerable properties. + * 检查 `value` 是否为空。 + * 判断的依据是除非是有枚举属性的对象,length 大于 `0` 的 `arguments` object, array, string 或类jquery选择器。 * * @static * @memberOf _ * @category Lang - * @param {Array|Object|string} value The value to inspect. - * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @param {Array|Object|string} value 要检查的值 + * @returns {boolean} 如果为空返回 `true`,否则返回 `false` * @example * * _.isEmpty(null); @@ -9352,21 +9347,19 @@ } /** - * Performs a deep comparison between two values to determine if they are - * equivalent. + * 执行深比较来决定两者的值是否相等。 * - * **注意:** This method supports comparing arrays, array buffers, booleans, + * **注意:** 这个方法支持比较 arrays, array buffers, booleans, * date objects, error objects, maps, numbers, `Object` objects, regexes, - * sets, strings, symbols, and typed arrays. `Object` objects are compared - * by their own, not inherited, enumerable properties. Functions and DOM - * nodes are **not** supported. + * sets, strings, symbols, 以及 typed arrays. `Object` 对象值比较自身的属性,不包括继承的和可枚举的属性。 + * 不支持函数和DOM节点。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 + * @returns {boolean} 如果相等返回 `true`,否则返回 `false` * @example * * var object = { 'user': 'fred' }; @@ -9383,18 +9376,17 @@ } /** - * This method is like `_.isEqual` except that it accepts `customizer` which is - * invoked to compare values. If `customizer` returns `undefined` comparisons are - * handled by the method instead. The `customizer` is invoked with up to seven arguments: - * (objValue, othValue [, index|key, object, other, stack]). + * 这个方法类似 `_.isEqual`。 + * 除了它接受一个 customizer 定制比较值。 如果 customizer 返回 undefined 将会比较处理方法代替。 + * `customizer` 会传入7个参数:(objValue, othValue [, index|key, object, other, stack]) * * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 + * @param {Function} [customizer] 这个函数定制比较值 + * @returns {boolean} 如果相等返回 `true`,否则返回 `false` * @example * * function isGreeting(value) { @@ -9420,14 +9412,14 @@ } /** - * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, - * `SyntaxError`, `TypeError`, or `URIError` object. + * 检查 `value` 是否是 `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, 或 `URIError` object. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是 error object 返回 `true`,否则返回 `false` * @example * * _.isError(new Error); @@ -9442,15 +9434,15 @@ } /** - * Checks if `value` is a finite primitive number. + * 检查 `value` 是否是原始 finite number。 * - * **注意:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite). + * **注意:** 这个方法基于 [`Number.isFinite`](https://mdn.io/Number/isFinite). * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是 finite number 返回 `true`,否则返回 `false` * @example * * _.isFinite(3); @@ -9470,13 +9462,13 @@ } /** - * Checks if `value` is classified as a `Function` object. + * 检查 `value` 是否是 `Function` 对象。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isFunction(_); @@ -9494,15 +9486,15 @@ } /** - * Checks if `value` is an integer. + * 检查 `value` 是否是整数。 * - * **注意:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger). + * **注意:** 这个方法基于 [`Number.isInteger`](https://mdn.io/Number/isInteger). * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是整数返回 `true`,否则返回 `false` * @example * * _.isInteger(3); @@ -9522,15 +9514,15 @@ } /** - * Checks if `value` is a valid array-like length. + * 检查 `value` 是否是有效长度 * - * **注意:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **注意:** 这个方法参考自 [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是有效长度返回 `true`,否则返回 `false` * @example * * _.isLength(3); @@ -9550,14 +9542,14 @@ } /** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * 检查 `value` 是否是 `Object` 的 [language type](https://es5.github.io/#x8)。 + * (例如: arrays, functions, objects, regexes, `new Number(0)`, 以及 `new String('')`) * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是对象返回 `true`,否则返回 `false` * @example * * _.isObject({}); @@ -9580,14 +9572,14 @@ } /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". + * 检查 `value` 是否是 类对象。 + * 类对象应该不是 `null` 以及 `typeof` 的结果是 "object"。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是类对象返回 `true`,否则返回 `false` * @example * * _.isObjectLike({}); @@ -9607,17 +9599,16 @@ } /** - * Performs a deep comparison between `object` and `source` to determine if - * `object` contains equivalent property values. + * 执行一个深比较来确定`object` 是否包含有 `source` 的属性值。 * - * **注意:** This method supports comparing the same values as `_.isEqual`. + * **注意:** 这个方法支持比较相同的值和 `_.isEqual` 一样 * * @static * @memberOf _ * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @param {Object} object 要检查的值 + * @param {Object} source 匹配包含在 object 的对象 + * @returns {boolean} 如果匹配返回 `true`,否则返回 `false` * @example * * var object = { 'user': 'fred', 'age': 40 }; @@ -9633,18 +9624,17 @@ } /** - * This method is like `_.isMatch` except that it accepts `customizer` which - * is invoked to compare values. If `customizer` returns `undefined` comparisons - * are handled by the method instead. The `customizer` is invoked with three - * arguments: (objValue, srcValue, index|key, object, source). + * 这个方法类似 `_.isMatch`。 + * 除了它接受一个 customizer 定制比较的值。 + * 如果 customizer 返回 undefined 将会比较处理方法代替。 customizer 会传入5个参数:(objValue, srcValue, index|key, object, source) * * @static * @memberOf _ * @category Lang - * @param {Object} object The object to inspect. - * @param {Object} source The object of property values to match. - * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @param {Object} object 要检查的值 + * @param {Object} source 匹配包含在 object 的对象 + * @param {Function} [customizer] 这个函数定制比较值 + * @returns {boolean} 如果匹配返回 `true`,否则返回 `false` * @example * * function isGreeting(value) { @@ -9669,16 +9659,16 @@ } /** - * Checks if `value` is `NaN`. + * 检查 `value` 是否是 `NaN`. * - * **注意:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4) - * which returns `true` for `undefined` and other non-numeric values. + * **注意:** 这个方法不同于 [`isNaN`](https://es5.github.io/#x15.1.2.4) + * 对 undefind 和 其他非数值返回 true. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果符合 `NaN` 返回 `true`,否则返回 `false` * @example * * _.isNaN(NaN); @@ -9700,13 +9690,13 @@ } /** - * Checks if `value` is a native function. + * 检查 `value` 是否是原生函数 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是原生函数返回 `true`,否则返回 `false` * @example * * _.isNative(Array.prototype.push); @@ -9727,13 +9717,13 @@ } /** - * Checks if `value` is `null`. + * 检查 `value` 是否是 `null`. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是 `null` 返回 `true`,否则返回 `false` * @example * * _.isNull(null); @@ -9747,13 +9737,13 @@ } /** - * Checks if `value` is `null` or `undefined`. + * 检查 `value` 是否是 `null` 或者 `undefined`。 * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是 `null` 或者 `undefined` 返回 `true`,否则返回 `false` * @example * * _.isNil(null); @@ -9770,7 +9760,7 @@ } /** - * Checks if `value` is classified as a `Number` primitive or object. + * 检查 `value` 是否是 as a `Number` primitive or object. * * **注意:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified * as numbers, use the `_.isFinite` method. @@ -9778,8 +9768,8 @@ * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isNumber(3); @@ -9800,14 +9790,14 @@ } /** - * Checks if `value` is a plain object, that is, an object created by the + * 检查 `value` 是否是 a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} Returns `true` if `value` is a plain object否则返回 `false` * @example * * function Foo() { @@ -9843,13 +9833,13 @@ } /** - * Checks if `value` is classified as a `RegExp` object. + * 检查 `value` 是否是 as a `RegExp` object. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isRegExp(/abc/); @@ -9863,7 +9853,7 @@ } /** - * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * 检查 `value` 是否是 a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * * **注意:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). @@ -9871,8 +9861,8 @@ * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} Returns `true` if `value` is a safe integer否则返回 `false` * @example * * _.isSafeInteger(3); @@ -9892,13 +9882,13 @@ } /** - * Checks if `value` is classified as a `String` primitive or object. + * 检查 `value` 是否是 as a `String` primitive or object. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isString('abc'); @@ -9913,13 +9903,13 @@ } /** - * Checks if `value` is classified as a `Symbol` primitive or object. + * 检查 `value` 是否是 as a `Symbol` primitive or object. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isSymbol(Symbol.iterator); @@ -9934,13 +9924,13 @@ } /** - * Checks if `value` is classified as a typed array. + * 检查 `value` 是否是 as a typed array. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} 如果是正确的类型,返回 `true`,否则返回 `false` * @example * * _.isTypedArray(new Uint8Array); @@ -9954,13 +9944,13 @@ } /** - * Checks if `value` is `undefined`. + * 检查 `value` 是否是 `undefined`. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @param {*} value 要检查的值 + * @returns {boolean} Returns `true` if `value` is `undefined`否则返回 `false` * @example * * _.isUndefined(void 0); @@ -9974,14 +9964,14 @@ } /** - * Checks if `value` is less than `other`. + * 检查 `value` 是否是 less than `other`. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 + * @returns {boolean} Returns `true` if `value` is less than `other`否则返回 `false` * @example * * _.lt(1, 3); @@ -9998,14 +9988,14 @@ } /** - * Checks if `value` is less than or equal to `other`. + * 检查 `value` 是否是 less than or equal to `other`. * * @static * @memberOf _ * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`. + * @param {*} value 要比较的值 + * @param {*} other 其他要比较的值 + * @returns {boolean} Returns `true` if `value` is less than or equal to `other`否则返回 `false` * @example * * _.lte(1, 3); @@ -10765,7 +10755,7 @@ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @returns {boolean} Returns `true` if `path` exists否则返回 `false` * @example * * var object = { 'a': { 'b': { 'c': 3 } } }; @@ -10795,7 +10785,7 @@ * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path to check. - * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @returns {boolean} Returns `true` if `path` exists否则返回 `false` * @example * * var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) }); @@ -11390,7 +11380,7 @@ * @category Object * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to unset. - * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @returns {boolean} Returns `true` if the property is deleted否则返回 `false` * @example * * var object = { 'a': [{ 'b': { 'c': 7 } }] }; @@ -11519,7 +11509,7 @@ * @param {number} number The number to check. * @param {number} [start=0] The start of the range. * @param {number} end The end of the range. - * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @returns {boolean} Returns `true` if `number` is in the range否则返回 `false` * @example * * _.inRange(3, 2, 4); @@ -11696,7 +11686,7 @@ * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. + * @returns {boolean} Returns `true` if `string` ends with `target`否则返回 `false` * @example * * _.endsWith('abc', 'c'); @@ -12130,7 +12120,7 @@ * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. + * @returns {boolean} Returns `true` if `string` starts with `target`否则返回 `false` * @example * * _.startsWith('abc', 'a'); @@ -12787,7 +12777,7 @@ /** * Creates a function that invokes the predicate properties of `source` with * the corresponding property values of a given object, returning `true` if - * all predicates return truthy, else `false`. + * all predicates return truthy否则返回 `false` * * @static * @memberOf _ @@ -12935,7 +12925,7 @@ /** * Creates a function that performs a deep partial comparison between a given * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. + * property values否则返回 `false` * * **注意:** This method supports comparing the same values as `_.isEqual`. * @@ -12961,7 +12951,7 @@ /** * Creates a function that performs a deep partial comparison between the * value at `path` of a given object to `srcValue`, returning `true` if the - * object value is equivalent, else `false`. + * object value is equivalent否则返回 `false` * * **注意:** This method supports comparing the same values as `_.isEqual`. * diff --git a/kebabCase.html b/kebabCase.html index 99a8ac8..a124775 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/keys.html b/keys.html index 098cbb9..aa50c8a 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 9542251..fe252fa 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/lowerCase.html b/lowerCase.html index 1157952..87a7777 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 a3613fd..78e5af8 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 9ee0cdd..c895d7f 100644 --- a/lt.html +++ b/lt.html @@ -392,21 +392,21 @@
-

lt source npm

+

lt source npm

_.lt(value, other)
-

Checks if value is less than other.

+

检查 value 是否是 less than other.

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is less than other, else false.

+

Returns true if value is less than other否则返回 false

示例

_.lt(1, 3);
diff --git a/lte.html b/lte.html
index 60818ed..2779e6d 100644
--- a/lte.html
+++ b/lte.html
@@ -392,21 +392,21 @@
 
 
-

lte source npm

+

lte source npm

_.lte(value, other)
-

Checks if value is less than or equal to other.

+

检查 value 是否是 less than or equal to other.

参数

    -
  1. value (*)

    The value to compare.

    +
  2. value (*)

    要比较的值

  3. -
  4. other (*)

    The other value to compare.

    +
  5. other (*)

    其他要比较的值

返回值 (boolean)

-

Returns true if value is less than or equal to other, else false.

+

Returns true if value is less than or equal to other否则返回 false

示例

_.lte(1, 3);
diff --git a/mapKeys.html b/mapKeys.html
index ebab95a..82c1ef5 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 bdafc0d..67a0710 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 b1c41b8..286e997 100644 --- a/matches.html +++ b/matches.html @@ -392,12 +392,12 @@

-

matches source npm

+

matches source npm

_.matches(source)

Creates a function that performs a deep partial comparison between a given object and source, returning true if the given object has equivalent -property values, else false. +property values否则返回 false

注意: This method supports comparing the same values as _.isEqual.

diff --git a/matchesProperty.html b/matchesProperty.html index e6b7fd1..df2d294 100644 --- a/matchesProperty.html +++ b/matchesProperty.html @@ -392,12 +392,12 @@
-

matchesProperty source npm

+

matchesProperty source npm

_.matchesProperty(path, srcValue)

Creates a function that performs a deep partial comparison between the value at path of a given object to srcValue, returning true if the -object value is equivalent, else false. +object value is equivalent否则返回 false

注意: This method supports comparing the same values as _.isEqual.

diff --git a/max.html b/max.html index d3b8709..b3ad48f 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 f762505..2b9ec73 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 6d5f930..33cbb73 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/merge.html b/merge.html index 3563dab..d312021 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 91450cf..14185de 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 6a41402..722e105 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 d5e2256..5d7b8e1 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 a34f875..3261d2c 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 96fba26..8e61f4f 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 9c62992..d260b84 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/noConflict.html b/noConflict.html index bc31fa6..c08ff48 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 30cc790..22e90de 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/nthArg.html b/nthArg.html index 9add3c8..7413e6b 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 15ea6fd..a04121e 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 f22ed68..620d569 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/over.html b/over.html index b51e4bc..d02888d 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/overEvery.html b/overEvery.html index 9598caa..2500767 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 4c569be..cfd47b1 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 2a73596..0f43eea 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 ed3f4ca..46da69c 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 0ce82df..8ca805e 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 f687e22..6b75a22 100644 --- a/pages.json +++ b/pages.json @@ -1,5 +1,5 @@ [{ "href":"/", - "html":"

lodash

\n

一个 JavaScript 的实用工具库, 表现一致性, 模块化, 高性能, 以及 可扩展

\n\n\n\n

Example

\n
_.assign({ 'a': 1 }, { 'b': 2 }, { 'c': 3 });\n// → { 'a': 1, 'b': 2, 'c': 3 }\n\n_.map([1, 2, 3], function(n) { return n * 3; });\n// → [3, 6, 9]\n
\n

特点

\n\n

关于翻译

\n\n
\n
" } + "html":"

lodash

\n

一个 JavaScript 的实用工具库, 表现一致性, 模块化, 高性能, 以及 可扩展

\n\n\n\n

Example

\n
_.assign({ 'a': 1 }, { 'b': 2 }, { 'c': 3 });\n// → { 'a': 1, 'b': 2, 'c': 3 }\n\n_.map([1, 2, 3], function(n) { return n * 3; });\n// → [3, 6, 9]\n
\n

特点

\n\n

关于翻译

\n\n
\n
" } ,{ "href":"/getting-started", "html":"

下载

\n

查看 版本区别 来选择适合你的版本

\n
    \n
  • 现代版本 (压缩版)\n适合现代浏览器(运行环境),例如:Chrome, Firefox, IE ≥ 9, & Safari ≥ 5.1
  • \n
  • 兼容版本 (压缩版)\n同时兼容旧的浏览器(运行环境),例如:IE ≤ 8 & PhantomJS
  • \n
\n

引入

\n

浏览器中使用:

\n
<script src="lodash.js"></script>\n

AMD 规范中使用:

\n
require(['lodash'], function(_) {});\n

使用 npm 安装:

\n
$ {sudo -H} npm i -g npm$ npm i --save lodash\n

Node.js/io.js 中使用:

\n
// 直接引用现代版本\nvar _ = require('lodash');\n\n// 或引用某分类下的所有方法\nvar array = require('lodash/array');\n\n// 或者引用具体方法 (很适合在 browserify/webpack 中做最小化打包)\nvar chunk = require('lodash/array/chunk');\n

查看 源码包 了解更多详情

\n

注意:\n在 REPL 中不要声明 特殊变量 "_",安装 n_ 来代替。

\n

模块格式

\n

lodash 还有多种构建模块的格式

\n\n

CDN 服务在 cdnjs & jsDelivr,通过 版本定制 构建你需要的模块,在找更多的功能用法? 试试 lodash-fp

\n

深入了解

\n

查看我们的 更新日志, 路线图, 以及 社区里的播客、文章、视频.

\n

兼容性

\n

在 Chrome 43-44, Firefox 38-39, IE 6-11, MS Edge, Safari 5-8, ChakraNode 0.12.2, Node.js 0.8.28, 0.10.40, 0.12.7, & 4.0.0, PhantomJS 1.9.8, RingoJS 0.11, & Rhino 1.7.6 测试通过

\n

自动化测试 & 持续集成 已在运作, 特别感谢 Sauce Labs 提供的浏览器自动化测试。

\n
\n
" } ,{ "href":"/custom-builds", @@ -245,213 +245,213 @@ ,{ "href":"/wrap", "html":"

wrap source npm

\n
_.wrap(value, wrapper)
\n\n

创建一个函数。提供的 value 包装在 wrapper 函数的第一个参数里。\n任何附加的参数都提供给 wrapper 函数。\n被调用时 this 绑定在创建的函数上。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要包装的值

    \n
  2. \n
  3. wrapper (Function)

    包装函数

    \n
  4. \n
\n

返回值 (Function)

\n

返回新的函数

\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
\n\n
" } ,{ "href":"/clone", - "html":"

clone source npm

\n
_.clone(value)
\n\n

Creates a shallow clone of value.\n
\n
\n注意: 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
\n\n
" } + "html":"

clone source npm

\n
_.clone(value)
\n\n

创建一个 value 的浅拷贝。\n
\n
\n注意: 这个方法参考自\nstructured clone algorithm\n以及支持 arrays、array buffers、 booleans、 date objects、maps、\nnumbers, Object objects, regexes, sets, strings, symbols, 以及 typed\narrays。\n参数对象的可枚举属性会拷贝为普通对象。\n一些不可拷贝的对象,例如error objects、functions, DOM nodes, 以及 WeakMaps 会返回空对象。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要拷贝的值

    \n
  2. \n
\n

返回值 (*)

\n

返回拷贝后的值

\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
\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
\n\n
" } + "html":"

cloneDeep source npm

\n
_.cloneDeep(value)
\n\n

这个方法类似 _.clone,除了它会递归拷贝 value

\n
\n\n

参数

\n
    \n
  1. value (*)

    要深拷贝的值

    \n
  2. \n
\n

返回值 (*)

\n

返回拷贝后的值

\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
\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
\n\n
" } + "html":"

cloneDeepWith source npm

\n
_.cloneDeepWith(value, [customizer])
\n\n

这个方法类似 _.cloneWith,除了它会递归拷贝 value

\n
\n\n

参数

\n
    \n
  1. value (*)

    要深拷贝的值

    \n
  2. \n
  3. [customizer] (Function)

    这个函数定制返回的拷贝值

    \n
  4. \n
\n

返回值 (*)

\n

返回拷贝后的值

\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
\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
\n\n
" } + "html":"

cloneWith source npm

\n
_.cloneWith(value, [customizer])
\n\n

这个方法类似 _.clone,除了它接受一个 customizer 定制返回的拷贝值。\n如果 customizer 返回 undefined 将会拷贝处理方法代替。\ncustomizer 会传入5个参数:(value [, index|key, object, stack])

\n
\n\n

参数

\n
    \n
  1. value (*)

    要拷贝的值

    \n
  2. \n
  3. [customizer] (Function)

    这个函数定制返回的拷贝值

    \n
  4. \n
\n

返回值 (*)

\n

返回拷贝后的值

\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
\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
\n\n
" } + "html":"

eq source npm

\n
_.eq(value, other)
\n\n

执行 SameValueZero 比较两者的值确定它们是否相等。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要比较的值

    \n
  2. \n
  3. other (*)

    其他要比较的值

    \n
  4. \n
\n

返回值 (boolean)

\n

相等返回 true,否则返回 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
\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
\n\n
" } + "html":"

gt source npm

\n
_.gt(value, other)
\n\n

检查 value 是否大于 other

\n
\n\n

参数

\n
    \n
  1. value (*)

    要比较的值

    \n
  2. \n
  3. other (*)

    其他要比较的值

    \n
  4. \n
\n

返回值 (boolean)

\n

如果 value 大于 other,返回 true,否则返回 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
\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
\n\n
" } + "html":"

gte source npm

\n
_.gte(value, other)
\n\n

检查 value 是否大于等于 other

\n
\n\n

参数

\n
    \n
  1. value (*)

    要比较的值

    \n
  2. \n
  3. other (*)

    其他要比较的值

    \n
  4. \n
\n

返回值 (boolean)

\n

如果 value 大于等于 other,返回 true,否则返回 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
\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
\n\n
" } + "html":"

isArguments source npm

\n
_.isArguments(value)
\n\n

检查 value 是否是 类 arguments 对象。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isArguments(function() { return arguments; }());\n// => true\n\n_.isArguments([1, 2, 3]);\n// => false\n
\n
\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
\n\n
" } + "html":"

isArray source npm

\n
_.isArray(value)
\n\n

检查 value 是否是 Array 类对象。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 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
\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
\n\n
" } + "html":"

isArrayLike source npm

\n
_.isArrayLike(value)
\n\n

检查 value 是否是类数组。\n如果是类数组的话,应该不是一个函数,而且 value.length 是个整数,大于等于 0,小于或等于 Number.MAX_SAFE_INTEGER

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是类数组,返回 true,否则返回 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
\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
\n\n
" } + "html":"

isArrayLikeObject source npm

\n
_.isArrayLikeObject(value)
\n\n

这个方法类似 _.isArrayLike,除了它还检查值是否是个对象。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是类数组对象,返回 true,否则返回 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
\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
\n\n
" } + "html":"

isBoolean source npm

\n
_.isBoolean(value)
\n\n

检查 value 是否是原始 boolean 类型或者对象。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isBoolean(false);\n// => true\n\n_.isBoolean(null);\n// => false\n
\n
\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
\n\n
" } + "html":"

isDate source npm

\n
_.isDate(value)
\n\n

检查 value 是否是 Date 类型

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isDate(new Date);\n// => true\n\n_.isDate('Mon April 23 2012');\n// => false\n
\n
\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
\n\n
" } + "html":"

isElement source npm

\n
_.isElement(value)
\n\n

检查 value 是否是可能是 DOM 元素

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是 DOM 元素返回 true,否则返回 false

\n
\n

示例

\n
_.isElement(document.body);\n// => true\n\n_.isElement('<body>');\n// => false\n
\n
\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
\n\n
" } + "html":"

isEmpty source npm

\n
_.isEmpty(value)
\n\n

检查 value 是否为空。\n判断的依据是除非是有枚举属性的对象,length 大于 0arguments object, array, string 或类jquery选择器。

\n
\n\n

参数

\n
    \n
  1. value (Array|Object|string)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果为空返回 true,否则返回 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
\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
\n注意: 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
\n\n
" } + "html":"

isEqual source npm

\n
_.isEqual(value, other)
\n\n

执行深比较来决定两者的值是否相等。\n
\n
\n注意: 这个方法支持比较 arrays, array buffers, booleans,\ndate objects, error objects, maps, numbers, Object objects, regexes,\nsets, strings, symbols, 以及 typed arrays. Object 对象值比较自身的属性,不包括继承的和可枚举的属性。\n不支持函数和DOM节点。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要比较的值

    \n
  2. \n
  3. other (*)

    其他要比较的值

    \n
  4. \n
\n

返回值 (boolean)

\n

如果相等返回 true,否则返回 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
\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
\n\n
" } + "html":"

isEqualWith source npm

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

这个方法类似 _.isEqual。\n除了它接受一个 customizer 定制比较值。 如果 customizer 返回 undefined 将会比较处理方法代替。\ncustomizer 会传入7个参数:(objValue, othValue [, index|key, object, other, stack])

\n
\n\n

参数

\n
    \n
  1. value (*)

    要比较的值

    \n
  2. \n
  3. other (*)

    其他要比较的值

    \n
  4. \n
  5. [customizer] (Function)

    这个函数定制比较值

    \n
  6. \n
\n

返回值 (boolean)

\n

如果相等返回 true,否则返回 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
\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
\n\n
" } + "html":"

isError source npm

\n
_.isError(value)
\n\n

检查 value 是否是 Error, EvalError, RangeError, ReferenceError,\nSyntaxError, TypeError, 或 URIError object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是 error object 返回 true,否则返回 false

\n
\n

示例

\n
_.isError(new Error);\n// => true\n\n_.isError(Error);\n// => false\n
\n
\n
\n\n
" } ,{ "href":"/isFinite", - "html":"

isFinite source npm

\n
_.isFinite(value)
\n\n

Checks if value is a finite primitive number.\n
\n
\n注意: 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
\n\n
" } + "html":"

isFinite source npm

\n
_.isFinite(value)
\n\n

检查 value 是否是原始 finite number。\n
\n
\n注意: 这个方法基于 Number.isFinite.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是 finite number 返回 true,否则返回 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
\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
\n\n
" } + "html":"

isFunction source npm

\n
_.isFunction(value)
\n\n

检查 value 是否是 Function 对象。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isFunction(_);\n// => true\n\n_.isFunction(/abc/);\n// => false\n
\n
\n
\n\n
" } ,{ "href":"/isInteger", - "html":"

isInteger source npm

\n
_.isInteger(value)
\n\n

Checks if value is an integer.\n
\n
\n注意: 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
\n\n
" } + "html":"

isInteger source npm

\n
_.isInteger(value)
\n\n

检查 value 是否是整数。\n
\n
\n注意: 这个方法基于 Number.isInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是整数返回 true,否则返回 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
\n\n
" } ,{ "href":"/isLength", - "html":"

isLength source npm

\n
_.isLength(value)
\n\n

Checks if value is a valid array-like length.\n
\n
\n注意: 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
\n\n
" } + "html":"

isLength source npm

\n
_.isLength(value)
\n\n

检查 value 是否是有效长度\n
\n
\n注意: 这个方法参考自 ToLength.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是有效长度返回 true,否则返回 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
\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
\n注意: 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
\n\n
" } + "html":"

isMatch source npm

\n
_.isMatch(object, source)
\n\n

执行一个深比较来确定object 是否包含有 source 的属性值。\n
\n
\n注意: 这个方法支持比较相同的值和 _.isEqual 一样

\n
\n\n

参数

\n
    \n
  1. object (Object)

    要检查的值

    \n
  2. \n
  3. source (Object)

    匹配包含在 object 的对象

    \n
  4. \n
\n

返回值 (boolean)

\n

如果匹配返回 true,否则返回 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
\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
\n\n
" } + "html":"

isMatchWith source npm

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

这个方法类似 _.isMatch。\n除了它接受一个 customizer 定制比较的值。 \n如果 customizer 返回 undefined 将会比较处理方法代替。 customizer 会传入5个参数:(objValue, srcValue, index|key, object, source)

\n
\n\n

参数

\n
    \n
  1. object (Object)

    要检查的值

    \n
  2. \n
  3. source (Object)

    匹配包含在 object 的对象

    \n
  4. \n
  5. [customizer] (Function)

    这个函数定制比较值

    \n
  6. \n
\n

返回值 (boolean)

\n

如果匹配返回 true,否则返回 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
\n\n
" } ,{ "href":"/isNaN", - "html":"

isNaN source npm

\n
_.isNaN(value)
\n\n

Checks if value is NaN.\n
\n
\n注意: 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
\n\n
" } + "html":"

isNaN source npm

\n
_.isNaN(value)
\n\n

检查 value 是否是 NaN.\n
\n
\n注意: 这个方法不同于 isNaN\n对 undefind 和 其他非数值返回 true.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果符合 NaN 返回 true,否则返回 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
\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
\n\n
" } + "html":"

isNative source npm

\n
_.isNative(value)
\n\n

检查 value 是否是原生函数

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是原生函数返回 true,否则返回 false

\n
\n

示例

\n
_.isNative(Array.prototype.push);\n// => true\n\n_.isNative(_);\n// => false\n
\n
\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
\n\n
" } + "html":"

isNil source npm

\n
_.isNil(value)
\n\n

检查 value 是否是 null 或者 undefined

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是 null 或者 undefined 返回 true,否则返回 false

\n
\n

示例

\n
_.isNil(null);\n// => true\n\n_.isNil(void 0);\n// => true\n\n_.isNil(NaN);\n// => false\n
\n
\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
\n\n
" } + "html":"

isNull source npm

\n
_.isNull(value)
\n\n

检查 value 是否是 null.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是 null 返回 true,否则返回 false

\n
\n

示例

\n
_.isNull(null);\n// => true\n\n_.isNull(void 0);\n// => false\n
\n
\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
\n注意: 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
\n\n
" } + "html":"

isNumber source npm

\n
_.isNumber(value)
\n\n

检查 value 是否是 as a Number primitive or object.\n
\n
\n注意: To exclude Infinity, -Infinity, and NaN, which are classified\nas numbers, use the _.isFinite method.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 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
\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
\n\n
" } + "html":"

isObject source npm

\n
_.isObject(value)
\n\n

检查 value 是否是 Objectlanguage type。\n(例如: arrays, functions, objects, regexes, new Number(0), 以及 new String(''))

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是对象返回 true,否则返回 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
\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
\n\n
" } + "html":"

isObjectLike source npm

\n
_.isObjectLike(value)
\n\n

检查 value 是否是 类对象。\n类对象应该不是 null 以及 typeof 的结果是 "object"。

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是类对象返回 true,否则返回 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
\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
\n\n
" } + "html":"

isPlainObject source npm

\n
_.isPlainObject(value)
\n\n

检查 value 是否是 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 (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a plain object否则返回 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
\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
\n\n
" } + "html":"

isRegExp source npm

\n
_.isRegExp(value)
\n\n

检查 value 是否是 as a RegExp object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isRegExp(/abc/);\n// => true\n\n_.isRegExp('/abc/');\n// => false\n
\n
\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
\n注意: 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
\n\n
" } + "html":"

isSafeInteger source npm

\n
_.isSafeInteger(value)
\n\n

检查 value 是否是 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
\n注意: This method is based on Number.isSafeInteger.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is a safe integer否则返回 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
\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
\n\n
" } + "html":"

isString source npm

\n
_.isString(value)
\n\n

检查 value 是否是 as a String primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isString('abc');\n// => true\n\n_.isString(1);\n// => false\n
\n
\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
\n\n
" } + "html":"

isSymbol source npm

\n
_.isSymbol(value)
\n\n

检查 value 是否是 as a Symbol primitive or object.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isSymbol(Symbol.iterator);\n// => true\n\n_.isSymbol('abc');\n// => false\n
\n
\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
\n\n
" } + "html":"

isTypedArray source npm

\n
_.isTypedArray(value)
\n\n

检查 value 是否是 as a typed array.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

如果是正确的类型,返回 true,否则返回 false

\n
\n

示例

\n
_.isTypedArray(new Uint8Array);\n// => true\n\n_.isTypedArray([]);\n// => false\n
\n
\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
\n\n
" } + "html":"

isUndefined source npm

\n
_.isUndefined(value)
\n\n

检查 value 是否是 undefined.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要检查的值

    \n
  2. \n
\n

返回值 (boolean)

\n

Returns true if value is undefined否则返回 false

\n
\n

示例

\n
_.isUndefined(void 0);\n// => true\n\n_.isUndefined(null);\n// => false\n
\n
\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
\n\n
" } + "html":"

lt source npm

\n
_.lt(value, other)
\n\n

检查 value 是否是 less than other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要比较的值

    \n
  2. \n
  3. other (*)

    其他要比较的值

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is less than other否则返回 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
\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
\n\n
" } + "html":"

lte source npm

\n
_.lte(value, other)
\n\n

检查 value 是否是 less than or equal to other.

\n
\n\n

参数

\n
    \n
  1. value (*)

    要比较的值

    \n
  2. \n
  3. other (*)

    其他要比较的值

    \n
  4. \n
\n

返回值 (boolean)

\n

Returns true if value is less than or equal to other否则返回 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
\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
\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
\n\n
" } ,{ "href":"/toInteger", - "html":"

toInteger source npm

\n
_.toInteger(value)
\n\n

Converts value to an integer.\n
\n
\n注意: 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
\n\n
" } + "html":"

toInteger source npm

\n
_.toInteger(value)
\n\n

Converts value to an integer.\n
\n
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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 会传入1个参数:(value)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    这个函数会处理每一个元素

    \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// 使用了 `_.property` 的回调结果\n_.maxBy(users, 'age');\n// => { 'user': 'fred', 'age': 40 }\n
\n
\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 会传入1个参数:(value)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    这个函数会处理每一个元素

    \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// 使用了 `_.property` 的回调结果\n_.maxBy(users, 'age');\n// => { 'user': 'fred', 'age': 40 }\n
\n
\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
\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
\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
\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
\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 会传入1个参数:(value)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    这个函数会处理每一个元素

    \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// 使用了 `_.property` 的回调结果\n_.minBy(users, 'age');\n// => { 'user': 'barney', 'age': 36 }\n
\n
\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 会传入1个参数:(value)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    这个函数会处理每一个元素

    \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// 使用了 `_.property` 的回调结果\n_.minBy(users, 'age');\n// => { 'user': 'barney', 'age': 36 }\n
\n
\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
\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
\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
\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
\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
\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
\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 会传入1个参数:(value)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    这个函数会处理每一个元素

    \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// 使用了 `_.property` 的回调结果\n_.sumBy(objects, 'n');\n// => 20\n
\n
\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 会传入1个参数:(value)。

\n
\n\n

参数

\n
    \n
  1. array (Array)

    The array to iterate over.

    \n
  2. \n
  3. [iteratee=_.identity] (Function|Object|string)

    这个函数会处理每一个元素

    \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// 使用了 `_.property` 的回调结果\n_.sumBy(objects, 'n');\n// => 20\n
\n
\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
\n\n
" } ,{ "href":"/templateSettings-imports-_", "html":"

templateSettings.imports._ source

\n
_.templateSettings.imports._
\n\n

A reference to the lodash function.

\n
\n\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
\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
\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
\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否则返回 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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
\n注意: 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
\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)

    这个函数会处理每一个元素

    \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' (无法保证遍历的顺序)\n\n// 使用了 `_.matches` 的回调结果\n_.findKey(users, { 'age': 1, 'active': true });\n// => 'pebbles'\n\n// 使用了 `_.matchesProperty` 的回调结果\n_.findKey(users, ['active', false]);\n// => 'fred'\n\n// 使用了 `_.property` 的回调结果\n_.findKey(users, 'active');\n// => 'barney'\n
\n
\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)

    这个函数会处理每一个元素

    \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' (无法保证遍历的顺序)\n\n// 使用了 `_.matches` 的回调结果\n_.findKey(users, { 'age': 1, 'active': true });\n// => 'pebbles'\n\n// 使用了 `_.matchesProperty` 的回调结果\n_.findKey(users, ['active', false]);\n// => 'fred'\n\n// 使用了 `_.property` 的回调结果\n_.findKey(users, 'active');\n// => 'barney'\n
\n
\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)

    这个函数会处理每一个元素

    \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// 使用了 `_.matches` 的回调结果\n_.findLastKey(users, { 'age': 36, 'active': true });\n// => 'barney'\n\n// 使用了 `_.matchesProperty` 的回调结果\n_.findLastKey(users, ['active', false]);\n// => 'fred'\n\n// 使用了 `_.property` 的回调结果\n_.findLastKey(users, 'active');\n// => 'pebbles'\n
\n
\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)

    这个函数会处理每一个元素

    \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// 使用了 `_.matches` 的回调结果\n_.findLastKey(users, { 'age': 36, 'active': true });\n// => 'barney'\n\n// 使用了 `_.matchesProperty` 的回调结果\n_.findLastKey(users, ['active', false]);\n// => 'fred'\n\n// 使用了 `_.property` 的回调结果\n_.findLastKey(users, 'active');\n// => 'pebbles'\n
\n
\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)

    这个函数会处理每一个元素

    \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' (无法保证遍历的顺序)\n
\n
\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)

    这个函数会处理每一个元素

    \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' (无法保证遍历的顺序)\n
\n
\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)

    这个函数会处理每一个元素

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

    这个函数会处理每一个元素

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

    这个函数会处理每一个元素

    \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' (无法保证遍历的顺序)\n
\n
\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)

    这个函数会处理每一个元素

    \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' (无法保证遍历的顺序)\n
\n
\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)

    这个函数会处理每一个元素

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

    这个函数会处理每一个元素

    \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
\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
\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
\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
\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
\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
\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
\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
\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否则返回 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
\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
\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否则返回 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
\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
\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
\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
\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
\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
\n注意: 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'] (无法保证遍历的顺序)\n\n_.keys('hi');\n// => ['0', '1']\n
\n
\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
\n注意: 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'] (无法保证遍历的顺序)\n\n_.keys('hi');\n// => ['0', '1']\n
\n
\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
\n注意: 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'] (无法保证遍历的顺序)\n
\n
\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
\n注意: 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'] (无法保证遍历的顺序)\n
\n
\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)

    这个函数会处理每一个元素

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

    这个函数会处理每一个元素

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

    这个函数会处理每一个元素

    \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 } (无法保证遍历的顺序)\n\n// 使用了 `_.property` 的回调结果\n_.mapValues(users, 'age');\n// => { 'fred': 40, 'pebbles': 1 } (无法保证遍历的顺序)\n
\n
\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)

    这个函数会处理每一个元素

    \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 } (无法保证遍历的顺序)\n\n// 使用了 `_.property` 的回调结果\n_.mapValues(users, 'age');\n// => { 'fred': 40, 'pebbles': 1 } (无法保证遍历的顺序)\n
\n
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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]] (无法保证遍历的顺序)\n
\n
\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]] (无法保证遍历的顺序)\n
\n
\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]] (无法保证遍历的顺序)\n
\n
\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]] (无法保证遍历的顺序)\n
\n
\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)

    这个函数会处理每一个元素

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

    这个函数会处理每一个元素

    \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
\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
\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否则返回 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
\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
\n注意: 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] (无法保证遍历的顺序)\n\n_.values('hi');\n// => ['h', 'i']\n
\n
\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
\n注意: 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] (无法保证遍历的顺序)\n\n_.values('hi');\n// => ['h', 'i']\n
\n
\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
\n注意: 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] (无法保证遍历的顺序)\n
\n
\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
\n注意: 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] (无法保证遍历的顺序)\n
\n
\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
\n\n
" } ,{ "href":"/templateSettings-escape", @@ -465,121 +465,121 @@ ,{ "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
\n\n
" } ,{ "href":"/VERSION", - "html":"

VERSION source

\n
_.VERSION
\n\n

(string): The semantic version number.

\n
\n\n
\n\n
" } + "html":"

VERSION source

\n
_.VERSION
\n\n

(string): The semantic version number.

\n
\n\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
\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
\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
\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
\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
\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
\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
\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否则返回 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
\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
\n注意: 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
\n\n
" } + "html":"

escape source npm

\n
_.escape([string=''])
\n\n

Converts the characters "&", "<", ">", '"', "'", and "`" in string to\ntheir corresponding HTML entities.\n
\n
\n注意: 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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\n注意: 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
\n\n
" } + "html":"

replace source npm

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

Replaces matches for pattern in string with replacement.\n
\n
\n注意: 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
\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
\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
\n\n
" } ,{ "href":"/split", - "html":"

split source npm

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

Splits string by separator.\n
\n
\n注意: 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
\n\n
" } + "html":"

split source npm

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

Splits string by separator.\n
\n
\n注意: 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
\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
\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
\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
\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否则返回 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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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否则返回 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
\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
\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
\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
\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
\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
\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
\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
\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
\n\n
" } ,{ "href":"/iteratee", - "html":"

iteratee source npm

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

创建一个调用 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
\n\n
" } + "html":"

iteratee source npm

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

创建一个调用 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
\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
\n注意: 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
\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否则返回 false\n
\n
\n注意: 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
\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
\n注意: 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
\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否则返回 false\n
\n
\n注意: 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
\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
\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
\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
\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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\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
\n注意: 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
\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
\n注意: 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
\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
\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
\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
\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)

    这个函数会处理每一个元素

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

    这个函数会处理每一个元素

    \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
\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
\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
\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
\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
\n\n
" } ] \ No newline at end of file diff --git a/parseInt.html b/parseInt.html index e1f777f..cc0526a 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/pick.html b/pick.html index 0595d7c..eb110d6 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 158427c..13b8796 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 6bdee00..727be7e 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 4c868f4..e8db47b 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/random.html b/random.html index 201cd7f..724f6ab 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 42e9a1e..eb46cbf 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 86e720e..360ccef 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/repeat.html b/repeat.html index 9f8f1f9..23e9c95 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 84b2674..df5723f 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/result.html b/result.html index 7e8f9f8..94e1773 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 af1e218..afe2a40 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/set.html b/set.html index cc6755a..96c5223 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 cf9ba7a..dd28849 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/snakeCase.html b/snakeCase.html index a373983..a795d78 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/split.html b/split.html index 589abce..40cac51 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/startCase.html b/startCase.html index 7581e1c..4c45774 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 786ab0f..2a7b04c 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.

@@ -408,7 +408,7 @@

参数

返回值 (boolean)

-

Returns true if string starts with target, else false.

+

Returns true if string starts with target否则返回 false

示例

_.startsWith('abc', 'a');
diff --git a/subtract.html b/subtract.html
index 12eaf37..8d42c99 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 1a1497b..2d2f27c 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 85d4f92..4c7b019 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/template.html b/template.html index 076e159..f2d071d 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/times.html b/times.html index a325b8d..3caa11c 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 1726dc9..21d23b4 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 f6c7d98..ccb6247 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 aeaf564..b35b73f 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 0501866..ed1d957 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 f2dcae0..cf2b152 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 b795d46..f96b8ae 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 ad2dbd8..c5373d9 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 ab53f10..b0f1ec6 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 234eca3..ea04ce9 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 da55402..4e1e1a0 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 86192c2..80a5624 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 67cdfb0..6775cd5 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 c7f981e..34951f9 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 ca07945..c85fc4e 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 ee5e4e5..d2ef1f0 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 fa99fc2..80a50c3 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 cf931a0..cf3b311 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/unescape.html b/unescape.html index 9e9679f..71cdbe6 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/uniqueId.html b/uniqueId.html index 01327dd..1bc8f12 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 7f1941e..2388383 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.

@@ -406,7 +406,7 @@

参数

返回值 (boolean)

-

Returns true if the property is deleted, else false.

+

Returns true if the property is deleted否则返回 false

示例

var object = { 'a': [{ 'b': { 'c': 7 } }] };
diff --git a/upperCase.html b/upperCase.html
index e32dd4d..127e63d 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 e9e8cb3..38d2ead 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 08d1c87..3b06ed9 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 3e5d795..ccbb370 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/words.html b/words.html index 1386ae4..e95aace 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.