Skip to content

identity ​

js
_.identity(value)

此方法返回它收到的第一个参数。

¥This method returns the first argument it receives.

新增于 ​

¥Since

0.1.0

参数 ​

¥Arguments

  1. value (*):任何值。

    ¥value ()*: Any value.

返回 ​

¥Returns

(*):返回 value。

¥()*: Returns value.

示例 ​

¥Example

js
var object = { 'a': 1 };

console.log(_.identity(object) === object);
// => true

Lodash v4.17 中文网 - 粤ICP备13048890号