VERSION source
+VERSION source
(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
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协议, 定时保持与官方同步,翻译质量可能没法特别好,但会保证尽可能反复细心。
- 如果您有任何建议,或者意见,欢迎在此讨论,及时更正 ;-)。
示例
clone source npm
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.
Object
objects, regexes, sets, strings, symbols, 以及 typed
+arrays。
+参数对象的可枚举属性会拷贝为普通对象。
+一些不可拷贝的对象,例如error objects、functions, DOM nodes, 以及 WeakMaps 会返回空对象。
参数
-
-
- value (*)
The value to clone.
+- 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 clonesvalue
.这个方法类似
_.clone
,除了它会递归拷贝value
。参数
-
-
- value (*)
The value to recursively clone.
+- 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 clonesvalue
.这个方法类似
_.cloneWith
,除了它会递归拷贝value
。参数
-
-
- value (*)
The value to recursively clone.
+- value (*)
-要深拷贝的值
- [customizer] (Function)
The function to customize cloning.
+- [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 acceptscustomizer
which -is invoked to produce the cloned value. Ifcustomizer
returnsundefined
-cloning is handled by the method instead. Thecustomizer
is invoked with -up to five arguments; (value [, index|key, object, stack]).这个方法类似
_.clone
,除了它接受一个customizer
定制返回的拷贝值。 +如果customizer
返回undefined
将会拷贝处理方法代替。 +customizer
会传入5个参数:(value [, index|key, object, stack])参数
-
-
- value (*)
The value to clone.
+- value (*)
-要拷贝的值
- [customizer] (Function)
The function to customize cloning.
+- [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
比较两者的值确定它们是否相等。参数
-
-
- value (*)
The value to compare.
+- value (*)
-要比较的值
- other (*)
The other value to compare.
+- other (*)
其他要比较的值
返回值 (boolean)
-Returns
+true
if the values are equivalent, elsefalse
.相等返回
true
,否则返回false
示例
-var object = { 'user': 'fred' }; @@ -7602,21 +7600,21 @@
示例
})();gt source npm
+gt source npm
_.gt(value, other)-Checks if
+value
is greater thanother
.检查
value
是否大于other
参数
-
-
- value (*)
The value to compare.
+- value (*)
-要比较的值
- other (*)
The other value to compare.
+- other (*)
其他要比较的值
返回值 (boolean)
-Returns
+true
ifvalue
is greater thanother
, elsefalse
.如果
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 toother
.检查
value
是否大于等于other
参数
-
-
- value (*)
The value to compare.
+- value (*)
-要比较的值
- other (*)
The other value to compare.
+- other (*)
其他要比较的值
返回值 (boolean)
-Returns
+true
ifvalue
is greater than or equal toother
, elsefalse
.如果
value
大于等于other
,返回true
,否则返回false
示例
-_.gte(3, 1); @@ -7710,19 +7708,19 @@
示例
})();isArguments source npm
+isArguments source npm
_.isArguments(value)-Checks if
+value
is likely anarguments
object.检查
value
是否是 类arguments
对象。参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is correctly classified, elsefalse
.如果是正确的类型,返回
true
,否则返回false
示例
-_.isArguments(function() { return arguments; }()); @@ -7759,19 +7757,19 @@
示例
})();isArray source npm
+isArray source npm
_.isArray(value)-Checks if
+value
is classified as anArray
object.检查
value
是否是Array
类对象。参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is correctly classified, elsefalse
.如果是正确的类型,返回
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 avalue.length
that's an integer greater than or -equal to0
and less than or equal toNumber.MAX_SAFE_INTEGER
.检查
value
是否是类数组。 +如果是类数组的话,应该不是一个函数,而且value.length
是个整数,大于等于 0,小于或等于Number.MAX_SAFE_INTEGER
参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is array-like, elsefalse
.如果是类数组,返回
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 ifvalue
-is an object.这个方法类似
_.isArrayLike
,除了它还检查值是否是个对象。参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is an array-like object, elsefalse
.如果是类数组对象,返回
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 类型或者对象。参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is correctly classified, elsefalse
.如果是正确的类型,返回
true
,否则返回false
示例
-_.isBoolean(false); @@ -7976,19 +7972,19 @@
示例
})();isDate source npm
+isDate source npm
_.isDate(value)-Checks if
+value
is classified as aDate
object.检查
value
是否是Date
类型参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is correctly classified, elsefalse
.如果是正确的类型,返回
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 元素参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is a DOM element, elsefalse
.如果是 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 than0
or an object with own enumerable properties.检查
value
是否为空。 +判断的依据是除非是有枚举属性的对象,length 大于0
的arguments
object, array, string 或类jquery选择器。参数
-
-
- value (Array|Object|string)
The value to inspect.
+- value (Array|Object|string)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is empty, elsefalse
.如果为空返回
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. +
执行深比较来决定两者的值是否相等。
+sets, strings, symbols, 以及 typed arrays.
-注意: 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.Object
对象值比较自身的属性,不包括继承的和可枚举的属性。 +不支持函数和DOM节点。参数
-
-
- value (*)
The value to compare.
+- value (*)
-要比较的值
- other (*)
The other value to compare.
+- other (*)
其他要比较的值
返回值 (boolean)
-Returns
+true
if the values are equivalent, elsefalse
.如果相等返回
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 acceptscustomizer
which is -invoked to compare values. Ifcustomizer
returnsundefined
comparisons are -handled by the method instead. Thecustomizer
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])参数
-
-
- value (*)
The value to compare.
+- value (*)
-要比较的值
- other (*)
The other value to compare.
+- other (*)
-其他要比较的值
- [customizer] (Function)
The function to customize comparisons.
+- [customizer] (Function)
这个函数定制比较值
返回值 (boolean)
-Returns
+true
if the values are equivalent, elsefalse
.如果相等返回
true
,否则返回false
示例
-function isGreeting(value) { @@ -8262,20 +8254,20 @@
示例
})();isError source npm
+isError source npm
_.isError(value)-Checks if
+value
is anError
,EvalError
,RangeError
,ReferenceError
, -SyntaxError
,TypeError
, orURIError
object.检查
value
是否是Error
,EvalError
,RangeError
,ReferenceError
, +SyntaxError
,TypeError
, 或URIError
object.参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is an error object, elsefalse
.如果是 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 onNumber.isFinite
.Number.isFinite
.参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is a finite number, elsefalse
.如果是 finite number 返回
true
,否则返回false
示例
-_.isFinite(3); @@ -8370,19 +8362,19 @@
示例
})();isFunction source npm
+isFunction source npm
_.isFunction(value)-Checks if
+value
is classified as aFunction
object.检查
value
是否是Function
对象。参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is correctly classified, elsefalse
.如果是正确的类型,返回
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 onNumber.isInteger
.Number.isInteger
.参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is an integer, elsefalse
.如果是整数返回
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 (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is a valid length, elsefalse
.如果是有效长度返回
true
,否则返回false
示例
-_.isLength(3); @@ -8535,25 +8527,24 @@
示例
})();isMatch source npm
+isMatch source npm
_.isMatch(object, source)-Performs a deep comparison between
object
andsource
to determine if -object
contains equivalent property values. +执行一个深比较来确定
+注意: 这个方法支持比较相同的值和object
是否包含有source
的属性值。
-注意: This method supports comparing the same values as_.isEqual
._.isEqual
一样参数
-
-
- object (Object)
The object to inspect.
+- object (Object)
-要检查的值
- source (Object)
The object of property values to match.
+- source (Object)
匹配包含在 object 的对象
返回值 (boolean)
-Returns
+true
ifobject
is a match, elsefalse
.如果匹配返回
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 acceptscustomizer
which -is invoked to compare values. Ifcustomizer
returnsundefined
comparisons -are handled by the method instead. Thecustomizer
is invoked with three -arguments: (objValue, srcValue, index|key, object, source).这个方法类似
_.isMatch
。 +除了它接受一个 customizer 定制比较的值。 +如果 customizer 返回 undefined 将会比较处理方法代替。 customizer 会传入5个参数:(objValue, srcValue, index|key, object, source)参数
-
-
- object (Object)
The object to inspect.
+- object (Object)
-要检查的值
- source (Object)
The object of property values to match.
+- source (Object)
-匹配包含在 object 的对象
- [customizer] (Function)
The function to customize comparisons.
+- [customizer] (Function)
这个函数定制比较值
返回值 (boolean)
-Returns
+true
ifobject
is a match, elsefalse
.如果匹配返回
true
,否则返回false
示例
-function isGreeting(value) { @@ -8658,23 +8648,23 @@
示例
})();isNaN source npm
+isNaN source npm
_.isNaN(value)-Checks if
value
isNaN
. +检查
+注意: 这个方法不同于value
是否是NaN
.
-注意: This method is not the same asisNaN
-which returnstrue
forundefined
and other non-numeric values.isNaN
+对 undefind 和 其他非数值返回 true.参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
isNaN
, elsefalse
.如果符合
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
是否是原生函数参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is a native function, elsefalse
.如果是原生函数返回
true
,否则返回false
示例
-_.isNative(Array.prototype.push); @@ -8766,19 +8756,19 @@
示例
})();isNil source npm
+isNil source npm
_.isNil(value)-Checks if
+value
isnull
orundefined
.检查
value
是否是null
或者undefined
。参数
-
-
- value (*)
The value to check.
+- value (*)
要检查的值
返回值 (boolean)
-Returns
+true
ifvalue
is nullish, elsefalse
.如果是
null
或者undefined
返回true
,否则返回false
示例
-_.isNil(null); @@ -8818,19 +8808,19 @@
示例
})(); - value (*)
- value (*)
- value (*)
- object (Object)
- object (Object)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (Array|Object|string)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)
- value (*)