constant
最后更新于:2022-04-02 00:08:12
## constant
+ [link](./constant "Link to this entry.")
+ [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L13223 "View in source.")
+ [npm](https://www.npmjs.com/package/lodash.constant "See the npm package.")
```
_.constant(value)
```
创建一个返回 `value` 的函数
### 参数
1. value (\*)
要返回的值
### 返回值 (Function)
返回新的函数
### 示例
```
var object = { 'user': 'fred' };
var getter = _.constant(object);
getter() === object;
// => true
```
';