Lodash _.prototype.commit

2021-09-23 14:27 更新

_.prototype.commit()

执行链式队列并返回结果。

添加版本

3.2.0

返回

(Object): 返回 lodash 的包装实例。

例子

var array = [1, 2];var wrapped = _(array).push(3); console.log(array);
// => [1, 2]
 wrapped = wrapped.commit();
console.log(array);
// => [1, 2, 3] 
wrapped.last();
// => 3 
console.log(array);
// => [1, 2, 3]


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号