mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 15:57:48 +00:00
Bump to v3.2.0.
This commit is contained in:
33
chain/wrapperCommit.js
Normal file
33
chain/wrapperCommit.js
Normal file
@@ -0,0 +1,33 @@
|
||||
define(['../internal/LodashWrapper'], function(LodashWrapper) {
|
||||
|
||||
/**
|
||||
* Executes the chained sequence and returns the wrapped result.
|
||||
*
|
||||
* @name commit
|
||||
* @memberOf _
|
||||
* @category Chain
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var array = [1, 2];
|
||||
* var wrapper = _(array).push(3);
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [1, 2]
|
||||
*
|
||||
* wrapper = wrapper.commit();
|
||||
* console.log(array);
|
||||
* // => [1, 2, 3]
|
||||
*
|
||||
* wrapper.last();
|
||||
* // => 3
|
||||
*
|
||||
* console.log(array);
|
||||
* // => [1, 2, 3]
|
||||
*/
|
||||
function wrapperCommit() {
|
||||
return new LodashWrapper(this.value(), this.__chain__);
|
||||
}
|
||||
|
||||
return wrapperCommit;
|
||||
});
|
||||
Reference in New Issue
Block a user