Files
lodash/commit.js
John-David Dalton 0646bacd86 Bump to v4.0.0.
2016-01-12 08:28:18 -08:00

33 lines
635 B
JavaScript

var LodashWrapper = require('./internal/LodashWrapper');
/**
* Executes the chained sequence and returns the wrapped result.
*
* @name commit
* @memberOf _
* @category Seq
* @returns {Object} Returns the new `lodash` wrapper instance.
* @example
*
* 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]
*/
function wrapperCommit() {
return new LodashWrapper(this.value(), this.__chain__);
}
module.exports = wrapperCommit;