服务器

Array

Collection

Date

Function

Lang

Math

Number

Object

Seq

String

Util

Properties

Methods

_.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]