_.prototype.chain
语法:
_.prototype.chain()
源代码链接:source
描述:
创建一个lodash
包装实例,启用显式链模式。
开始版本:0.1.0
返回值:
(Object)
: 返回 lodash 的包装实例。
例子:
var users = [
{ 'user': 'barney', 'age': 36 },
{ 'user': 'fred', 'age': 40 }
];
// A sequence without explicit chaining.
_(users).head();
// => { 'user': 'barney', 'age': 36 }
// A sequence with explicit chaining.
_(users)
.chain()
.head()
.pick('user')
.value();
// => { 'user': 'barney' }
Last updated
Was this helpful?