检索数据类型并返回数据类型名称
- Source:
Parameters:
Name | Type | Description |
---|---|---|
variable |
Any
|
要判断的数据 |
Returns:
- Type:
-
String
数据类型名,具体参考以下 number string boolean null undefined symbol function array object date regexp error ...
- Source:
Parameters:
Name | Type | Description |
---|---|---|
data |
Any
|
被拷贝的数据 |
Returns:
- Type:
-
Any
返回新的数据
- Source:
Parameters:
Name | Type | Description |
---|---|---|
参数为object对象 |
Any
|
Returns:
- Type:
-
Object
返回一个新的对象
Example
extend({a: 1}, {a: 2, b: 1}) // { a: 2, b: 1 }